浏览代码

Search for the term itself as well as its completion

Daoud Clarke 2 年之前
父节点
当前提交
b99d9d1c6a
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      mwmbl/tinysearchengine/rank.py

+ 1 - 1
mwmbl/tinysearchengine/rank.py

@@ -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