search-with-images22
All checks were successful
Deploy on push / deploy (push) Successful in 1m9s

This commit is contained in:
2024-06-02 18:34:15 +03:00
parent ebf1309b48
commit c1fe419ff9
2 changed files with 8 additions and 7 deletions

View File

@@ -307,11 +307,13 @@ async def load_shouts_search(_, _info, text, limit=50, offset=0):
scores[shout_id] = sr.get("score")
hits_ids.append(shout_id)
result = local_session().execute(query_shouts()).unique()
shouts = []
for shout in result:
shout.score = scores[f"{shout.id}"]
shouts.append(shout)
shouts.sort(key=lambda x: x.score, reverse=True)
if result:
logger.debug(result)
shouts = []
for shout in result:
shout.score = scores[f"{shout.id}"]
shouts.append(shout)
shouts.sort(key=lambda x: x.score, reverse=True)
return shouts
return []