mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-12-07 23:35:22 +01:00
Sonar fix
This commit is contained in:
parent
d915c142e2
commit
5529427b78
1 changed files with 14 additions and 18 deletions
|
|
@ -319,15 +319,13 @@ class DelayedQuery:
|
||||||
self.first_score = results[0].score
|
self.first_score = results[0].score
|
||||||
|
|
||||||
if self.first_score:
|
if self.first_score:
|
||||||
results.top_n = list(
|
results.top_n = [
|
||||||
map(
|
(
|
||||||
lambda hit: (
|
(hit[0] / self.first_score) if self.first_score else None,
|
||||||
(hit[0] / self.first_score) if self.first_score else None,
|
hit[1],
|
||||||
hit[1],
|
)
|
||||||
),
|
for hit in results.top_n
|
||||||
results.top_n,
|
]
|
||||||
),
|
|
||||||
)
|
|
||||||
|
|
||||||
hits_by_id = {hit["id"]: hit for hit in results}
|
hits_by_id = {hit["id"]: hit for hit in results}
|
||||||
matching_ids = list(hits_by_id.keys())
|
matching_ids = list(hits_by_id.keys())
|
||||||
|
|
@ -377,15 +375,13 @@ class DelayedQuery:
|
||||||
if not self.first_score and len(page.results) > 0 and sortedby is None:
|
if not self.first_score and len(page.results) > 0 and sortedby is None:
|
||||||
self.first_score = page.results[0].score
|
self.first_score = page.results[0].score
|
||||||
|
|
||||||
page.results.top_n = list(
|
page.results.top_n = [
|
||||||
map(
|
(
|
||||||
lambda hit: (
|
(hit[0] / self.first_score) if self.first_score else None,
|
||||||
(hit[0] / self.first_score) if self.first_score else None,
|
hit[1],
|
||||||
hit[1],
|
)
|
||||||
),
|
for hit in page.results.top_n
|
||||||
page.results.top_n,
|
]
|
||||||
),
|
|
||||||
)
|
|
||||||
|
|
||||||
self.saved_results[item.start] = page
|
self.saved_results[item.start] = page
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue