search-query-fix-6
All checks were successful
deploy / deploy (push) Successful in 1m27s

This commit is contained in:
Untone 2023-12-25 05:01:49 +03:00
parent ec70549e48
commit 5492887a10

View File

@ -287,7 +287,9 @@ async def load_shouts_feed(_, info, options):
async def load_shouts_search(_, _info, text, limit=50, offset=0):
if text and len(text) > 2:
results = await SearchService.search(text, limit, offset)
results_dict = {[s["slug"]]: s for s in results} # { slug, title, score }
results_dict = {}
for r in results:
results_dict[r["slug"]] = r
q = (
select(Shout) # Add "score" column
.options(