Skip to content

Commit

Permalink
Replace edge ngram tokenizer with ngram to prevent partial matches
Browse files Browse the repository at this point in the history
  • Loading branch information
akmiller01 committed Aug 4, 2023
1 parent d1208ec commit 3865165
Showing 1 changed file with 3 additions and 12 deletions.
15 changes: 3 additions & 12 deletions di_website/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,12 +166,6 @@

if config('ELASTIC_SEARCH_URL', ''):

elastic_search_tokens = [
'letter',
'digit',
'symbol',
]

WAGTAILSEARCH_BACKENDS = {
'default': {
'BACKEND': 'wagtail.search.backends.elasticsearch7',
Expand All @@ -184,7 +178,7 @@
'analysis': {
'analyzer': {
"default": {
"tokenizer": "edgengram_tokenizer",
"tokenizer": "standard_tokenizer",
"filter": [ "stop_filter", "lowercase_filter" ]
}
},
Expand All @@ -198,11 +192,8 @@
}
},
'tokenizer': {
'edgengram_tokenizer': {
'type': 'edge_ngram',
'min_gram': 3,
'max_gram': 10,
'token_chars': elastic_search_tokens
'standard_tokenizer': {
'type': 'standard'
}
},
},
Expand Down

0 comments on commit 3865165

Please sign in to comment.