Warm tip: This article is reproduced from serverfault.com, please click

What's the difference between Search-as-you-type datatype and Edge NGram Tokenizer?

发布于 2019-09-08 02:04:42

Can't understand the difference between setting a Search-as-you-type datatype to a field, setting an Edge NGram Tokenizer in analyzer, and adding an index_prefixes parameter. It seems to me that they do the same job after all.

https://www.elastic.co/guide/en/elasticsearch/reference/current/search-as-you-type.html https://www.elastic.co/guide/en/elasticsearch/reference/current/analysis-edgengram-tokenizer.html https://www.elastic.co/guide/en/elasticsearch/reference/current/index-prefixes.html

Questioner
Anton
Viewed
0
Rafiqul Islam 2020-11-30 02:04:21

edge_ngram is a tokenizer, which means it kicks in at indexing time to tokenize your input data. There is also a edge_ngram token filter. Both are similar but work at different levels.

search_as_you_type is a field type which contains a few sub-fields, one of which is called _index_prefix and which leverages the edge_ngram tokenizer.

So basically, what you see in the edge_ngram tokenizer documentation has actually been leveraged when they decided to add the new search_as_you_type field type.