mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-04-09 09:58:20 -05:00
autocomplete ordering
This commit is contained in:
parent
05f20c19c3
commit
689b0db1a8
@ -108,8 +108,6 @@ def query_index(ix, querystr):
|
|||||||
def autocomplete(ix, term, limit=10):
|
def autocomplete(ix, term, limit=10):
|
||||||
with ix.reader() as reader:
|
with ix.reader() as reader:
|
||||||
terms = []
|
terms = []
|
||||||
for t in reader.expand_prefix("content", term.lower()):
|
for (score, t) in reader.most_distinctive_terms("content", limit, term.lower()):
|
||||||
terms.append(t)
|
terms.append(t)
|
||||||
if len(terms) >= limit:
|
|
||||||
break
|
|
||||||
return terms
|
return terms
|
||||||
|
Loading…
x
Reference in New Issue
Block a user