Skip to content

Commit 393d3cf

Browse files
committed
Fixed a bug with Whoosh's edge n-gram support to be consistent with the implementation in the other engines.
1 parent b0ffed7 commit 393d3cf

File tree

2 files changed

+220
-216
lines changed

2 files changed

+220
-216
lines changed

haystack/backends/whoosh_backend.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ def build_schema(self, fields):
148148
elif field_class.field_type == 'ngram':
149149
schema_fields[field_class.index_fieldname] = NGRAM(minsize=3, maxsize=15, stored=field_class.stored, field_boost=field_class.boost)
150150
elif field_class.field_type == 'edge_ngram':
151-
schema_fields[field_class.index_fieldname] = NGRAMWORDS(minsize=2, maxsize=15, stored=field_class.stored, field_boost=field_class.boost)
151+
schema_fields[field_class.index_fieldname] = NGRAMWORDS(minsize=2, maxsize=15, at='start', stored=field_class.stored, field_boost=field_class.boost)
152152
else:
153153
schema_fields[field_class.index_fieldname] = TEXT(stored=True, analyzer=StemmingAnalyzer(), field_boost=field_class.boost)
154154

0 commit comments

Comments
 (0)