I am new to elasticsearch. I am bit confused over, elasticsearch match and multimatch query. What's the difference between both query types ? When each one of them must be used ? What's the performance implication of using each of them ?
Thanks in advance.
You can easily see this differences between multimatch
and match
query difference with the documentation. For example, multimatch
query with type most_fields
GET /_search
{
"query": {
"multi_match" : {
"query": "quick brown fox",
"type": "most_fields",
"fields": [ "title", "title.original", "title.shingles" ]
}
}
}
This would be executed as:
GET /_search
{
"query": {
"bool": {
"should": [
{ "match": { "title": "quick brown fox" }},
{ "match": { "title.original": "quick brown fox" }},
{ "match": { "title.shingles": "quick brown fox" }}
]
}
}
}
As you can see, multimatch
query build from match
queries. So, I think, the perfomance issue is related your query structure. You can choose another query wihch can be more productive or not.
The other type of the multimatch
query is the same situation with most_fields
type. For example, Phrase
type, most_fields
type.
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