mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-12-01 20:36:21 -05:00
Bump libzim to 4, cachetools to 8, certifi, py7zr, uvicorn (#1079)
Combines Dependabot PRs #1072-#1076 and #1078 and regenerates the hash locks. libzim 4 renames getResults/getEstimatedMatches to snake_case, and full-text search results are now SearchResult objects (suggestions are still paths), so libzim_worker.py reads .path from them. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
33cbc64780
commit
8efb6665d9
5 changed files with 42 additions and 62 deletions
|
|
@ -62,16 +62,17 @@ def run_job(job: dict) -> dict:
|
|||
result = dict()
|
||||
if op == 'estimate':
|
||||
query = Query().set_query(job['search_str'])
|
||||
result['estimate'] = Searcher(archive).search(query).getEstimatedMatches()
|
||||
result['estimate'] = Searcher(archive).search(query).get_estimated_matches()
|
||||
elif op == 'search':
|
||||
search_str, offset, limit = job['search_str'], job['offset'], job['limit']
|
||||
query = Query().set_query(search_str)
|
||||
# Suggestions search the titles.
|
||||
suggested = list(SuggestionSearcher(archive).suggest(search_str).getResults(offset, limit))
|
||||
suggested = list(SuggestionSearcher(archive).suggest(search_str).get_results(offset, limit))
|
||||
search = Searcher(archive).search(query)
|
||||
found = list(search.getResults(offset, limit))
|
||||
# Search results are SearchResult objects; suggestions are paths.
|
||||
found = [i.path for i in search.get_results(offset, limit)]
|
||||
paths = unique_paths(*suggested, *found)[:limit]
|
||||
result['estimate'] = search.getEstimatedMatches()
|
||||
result['estimate'] = search.get_estimated_matches()
|
||||
result['entries'] = [entry_dict(archive, i) for i in paths]
|
||||
elif op == 'entries':
|
||||
result['entries'] = [entry_dict(archive, i) for i in job['paths']]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue