Search for the term itself as well as its completion

This commit is contained in:
Daoud Clarke 2022-08-01 23:38:14 +01:00
parent 87d2e9474c
commit a40259af30

View file

@ -138,7 +138,7 @@ class Ranker:
terms = [x.lower() for x in q.replace('.', ' ').split()]
is_complete = q.endswith(' ')
if len(terms) > 0 and not is_complete:
retrieval_terms = terms[:-1] + self.completer.complete(terms[-1])
retrieval_terms = terms + self.completer.complete(terms[-1])
else:
retrieval_terms = terms