I have documents that represent users. They have fields name
and surname
.
Let's say I have two users indexed - Michael Jackson and Michael Starr. I want these sample searches to work:
- Michael => { Michael Jackson, Michael Starr }
- Jack Mich => { Michael Jackson } (incomplete words and reversed order)
- Michal Star => { Michael Starr } (fuzzy search)
I tried different queries and got the best results from multi_match query with cross_fields type. There are 2 problems though:
- It only finds something when at least one of the two words is complete. If I type Jackson Mich, it finds Michael Jackson but if I type Jack Mich, it doens't find anything (but I want it to find it).
- It cannot be set to fuzzy search. I really need the fuzzy search but keep the quality of multi_match with cross_fields type.
In other words, I want to implement Facebook-like people searching.
I'm pretty new to ElasticSearch so maybe I'm missing something obvious. Sorry if I do.