1
0
mirror of https://github.com/peeringdb/peeringdb.git synced 2024-05-11 05:55:09 +00:00

Fix 23 search result order (#1002)

* fix search results listed in wrong order (#23)

* no longer need to call highlight

Co-authored-by: Stefan Pratter <stefan@20c.com>
This commit is contained in:
Matt Griswold
2021-07-13 08:21:43 -05:00
committed by GitHub
parent 5147028bee
commit 3dd72435ca

View File

@@ -108,15 +108,12 @@ def search(term, autocomplete=False):
result = {tag: [] for tag in categories}
pk_map = {tag: {} for tag in categories}
for sq in search_query.highlight()[:limit]:
for sq in search_query[:limit]:
model = sq.model
tag = model.HandleRef.tag
categorize(sq, result, pk_map)
for _result in result.values():
_result.reverse()
# print("done", time.time() - t0)
return result