This commit is contained in:
parent
d528da9b4a
commit
c76e1625f3
|
@ -300,11 +300,10 @@ async def load_shouts_search(_, _info, text, limit=50, offset=0):
|
||||||
with local_session() as session:
|
with local_session() as session:
|
||||||
results = session.execute(q).unique()
|
results = session.execute(q).unique()
|
||||||
|
|
||||||
# Assuming Shout has a score attribute, you can update each result with the score
|
|
||||||
for result in results:
|
for result in results:
|
||||||
shout_slug = result[0].slug # Assuming id is the primary key of Shout
|
shout_slug = result.get("slug")
|
||||||
score = results_dict.get(shout_slug, {}).get("score", 0)
|
score = results_dict.get(shout_slug, {}).get("score", 0)
|
||||||
setattr(result[0], "score", score)
|
result["score"] = score
|
||||||
|
|
||||||
return results
|
return results
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user