Wildcard and Fuzzy query together in elastic search
{ "query": { "bool": { "should": [ { "match": { "title": "testing" } }, { "wildcard": { "title": "*testing*" } }, { "fuzzy": { "title": "testing" } } ], "minimum_should_match": 1 } }}
You can use it with Query String with wildcards. The suffix ~AUTO*
enables a prefix query with fuzzy, also you can use the fields selection like multi_match
query:
{ "query": { "query_string" : { "fields" : ["name^2", "content^1"], "query" : "elasttc~AUTO*" } }}
You can change the AUTO
keyword with a numeric value too, as the same fuzziness
parameter.