ElasticSearch Edge NGram vs Prefix query ElasticSearch Edge NGram vs Prefix query elasticsearch elasticsearch

ElasticSearch Edge NGram vs Prefix query


First thing first:

Keyword fields are only searchable by their exact value

Thus you can't prefix-search a field that is defined as keyword type . prefix-search is only work for analyzed fields.

In general prefix-search has relatively poor performance. You can improve it's functionality by index_prefixes but even then it is relatively intense operation so if you plan to scale your business, it is better to use N-Grams because it is more resource efficient.