only show score when sorting by score

This commit is contained in:
jonaswinkler
2021-05-15 17:25:49 +02:00
parent 4f62fc81c6
commit 4daab1809d
2 changed files with 8 additions and 6 deletions

View File

@@ -246,11 +246,13 @@ class DelayedQuery:
sortedby is None):
self.first_score = page.results[0].score
if self.first_score:
page.results.top_n = list(map(
lambda hit: (hit[0] / self.first_score, hit[1]),
page.results.top_n
))
page.results.top_n = list(map(
lambda hit: (
(hit[0] / self.first_score) if self.first_score else None,
hit[1]
),
page.results.top_n
))
self.saved_results[item.start] = page