This repository has been archived by the owner on Apr 5, 2021. It is now read-only.
Update autocomplete ES filters and use whitespace tokenizer #9
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR is an update to the elastic search config for the
autocomplete
type on both index and search analyzers. The main differences here are:min_gram
to1
.el paso
,la verne
) or resemble stop words (A & M
).stop
words filter.autocomplete
query is using thecommon
query which effectively is already dynamically dropping common words (including stop words) according to some of the supplied parameters. see this post for more on the common query.whitespace
tokenizer.standard
tokenizer is dropping some special characters that when supplied to a query (in the context of ourcommon
query using anand
for low frequency terms) will not match as the special character would be missing from any indexed documents. Using thewhitespace
tokenizer for indexing and searching, we instead only split on whitespace and allow terms with-
&
and others that join words.word_delimiter
filter.subwords
that thewhitespace
tokenizer would lose, for exampleCalifornia-Berkeley
, we add theword_delimiter
filter that will again split on special characters. This is only helpful when specifying thepreserve_original
flag so that we can also index the original term so as to keep any hyphenated or other joined words. I think this is helpful in scenarios like the Berkeley example where the words can be searched independently, as well as it appears in the name. Additionally helpful when one of the two words may be a common (high frequency word).