Edge n-gram indexing breaks each token into prefixes anchored at its beginning. For “action,” it produces “a,” “ac,” “act,” “acti,” “actio,” and “action,” making partial input useful for typeahead-style search. section 4.6.6 section 7.7.2
Generating prefixes with an edge_ngram tokenizer
A custom analyzer can attach an edge_ngram tokenizer with minimum and maximum prefix lengths. For “bond,” a configuration using sizes 2 through 6 produces “bo,” “bon,” and “bond” (with longer tokens continuing up to the configured maximum). The _analyze API lets you inspect the generated terms before using the analyzer in an index. section 7.7.2
Inspect the tokenizer fragment that sets edge_ngram, min_gram, max_gram, and accepted token characters. section 7.7.2
For typeahead search, Elasticsearch can also provide the search_as_you_type field, which creates analyzed subfields automatically. A bool_prefix multi_match query searches the main field and its shingle-based subfields together. section 4.6.6
