Added indexer tests
This commit is contained in:
@@ -3,7 +3,7 @@ from whoosh.analysis import StemmingAnalyzer, CharsetFilter
|
||||
from whoosh.support.charset import accent_map
|
||||
from whoosh.fields import Schema, TEXT, KEYWORD, NUMERIC
|
||||
from whoosh.qparser import QueryParser
|
||||
from whoosh.query import Term, NullQuery, Prefix
|
||||
from whoosh.query import Term, NullQuery, FuzzyTerm
|
||||
|
||||
|
||||
from typing import Any
|
||||
@@ -69,7 +69,6 @@ def search(
|
||||
limit = NullQuery
|
||||
for c in collections:
|
||||
limit |= Term("collection", c)
|
||||
print(limit)
|
||||
|
||||
hits = []
|
||||
ix = get_index()
|
||||
@@ -78,7 +77,7 @@ def search(
|
||||
|
||||
# if no results, do a prefix search
|
||||
if results.results.is_empty():
|
||||
qp.termclass = Prefix
|
||||
qp.termclass = FuzzyTerm
|
||||
q = qp.parse(query)
|
||||
results = searcher.search_page(q & limit, page, pagesize)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user