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:
I tried different queries and got the best results from multi_match query with cross_fields type. There are 2 problems though:
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.
In Elasticsearch, fuzzy query means the terms are not the exact matches of the index. The result is 2, but you can use fuzziness to find the correct word for a typo in Elasticsearch's fuzzy in Match Query. For 6 characters, the Elasticsearch by default will allow 2 edit distance.
The multi_match query provides a convenient shorthand way of running the same query against multiple fields.
Multi-Match® Multi-Match is a lotto-style game. For just $2.00, you get to play 18 numbers with four easy ways to match and win. When you play Multi-Match, for each game you play, you will be able to select your first line of six numbers or you can choose Quick Pick.
Fuzzy queryedit. Returns documents that contain terms similar to the search term, as measured by a Levenshtein edit distance. An edit distance is the number of one-character changes needed to turn one term into another.
Jack Mich type of searches
You are using the correct query type. These two should solve your problems.
PS: We all are learning here, doing that together is fun :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With