Wildcard and Fuzzy query together


(Pranav) #1

Hello everyone,

I am trying to design a query in which, I can use wildcard and Fuzzy query together.

According to me, query_string is used for wildcard searches and multi_match can be used for fuzziness.

I want a query which will search on words :-

  1. "elast" : - provide results elastic and elasticsearch.
  2. "elasttc" :- also provide results as elastic and elasticsearch.

(Pranav) #2

@elastic
Please answer my query.


(David Pilato) #3

Don't use wildcards but prefer ngram based analyzers.
Combine multiple queries into a bool query with multiple should clauses.


(Pranav) #4

Thank you so much :grinning: @dadoonet

It worked for me.


(Pranav) #5

Ngram based analyzers for this type query has few issues.
For example, when i search for "svsjhsdlasticdskajbfd" gives elastic and elasticsearch in results since "lastic" is present in "svsjhsdlasticdskajbfd" as my mingram value is 4. I am restricted to increase my mingram size.


(system) #6

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.