Hi,
I am working on query that has multiple clauses within one should clause
My query :
{
"from": 0,
"size": 5,
"_source": {},
"query": {
"bool": {
"should": [
{
"bool": {
"should": [
{
"multi_match": {
"query": "Elastic Seirch Forum",
"boost": "10",
"operator": "and",
"analyzer": "whitespace",
"fuzziness": "AUTO:4,7",
"prefix_length": 1,
"max_expansions": 2,
"fields": [
"Football"
]
}
},
{
"multi_match": {
"query": "Elastic Seirch Forum",
"boost": "10",
"analyzer": "whitespace",
"fields": [
"Football"
]
}
}
],
"minimum_should_match": 1
}
}
],
"minimum_should_match": 1
}
},
"highlight": {
"type": "unified",
"fields": {
"Football": {}
}
}
}
My highlight is :
"highlight": {
"Football": [
"<em>search</em> <em>forum</em>"
]
}
Here in first clause of the should query, I have mentioned "operator" : "and" which practically means all the words has to be present in the field mentioned for it to be matched. Therefore, "search" and "forum" present in "football" field should not be highlighted since "Football" contains only "search" and "forum".
Also, In the second part of the query i.e, without fuzziness and "operator" :"and" . Therefore, only "forum" has to be highlighted.
These conditions are working fine when these queries are fired individually. When both of these queries are fired in a single should clause, even "search" is highlighted.
I wish to know why "search" is highlighted when I have clearly mentioned "operator":"and" in my multimatch with Fuzziness ?