WARNING: The 2.x versions of Elasticsearch have passed their EOL dates. If you are running a 2.x version, we strongly advise you to upgrade.
This documentation is no longer maintained and may be removed. For the latest information, see the current Elasticsearch documentation.
Fuzzy match Queryedit
The match
query supports fuzzy matching out of the box:
GET /my_index/my_type/_search { "query": { "match": { "text": { "query": "SURPRIZE ME!", "fuzziness": "AUTO", "operator": "and" } } } }
The query string is first analyzed, to produce the terms [surprize, me]
, and
then each term is fuzzified using the specified fuzziness
.
Similarly, the multi_match
query also supports fuzziness
, but only when
executing with type best_fields
or most_fields
:
GET /my_index/my_type/_search { "query": { "multi_match": { "fields": [ "text", "title" ], "query": "SURPRIZE ME!", "fuzziness": "AUTO" } } }
Both the match
and multi_match
queries also support the prefix_length
and max_expansions
parameters.
Fuzziness works only with the basic match
and multi_match
queries. It
doesn’t work with phrase matching, common terms, or cross_fields
matches.