# Elasticsearch | Should query combining multiple clauses

**URL:** <https://discuss.elastic.co/t/elasticsearch-should-query-combining-multiple-clauses/162964>\
**Category:** Elasticsearch\
**Created:** [January 4, 2019, 1:42pm UTC](https://discuss.elastic.co/t/elasticsearch-should-query-combining-multiple-clauses/162964 "2019-01-04T13:42:24Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nikesh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nikesh/32/86579_2.png) [@Nikesh](https://discuss.elastic.co/u/Nikesh)\
**Post date:** [January 4, 2019, 1:42pm UTC](https://discuss.elastic.co/t/elasticsearch-should-query-combining-multiple-clauses/162964/1 "2019-01-04T13:42:24Z")

</div>

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 ?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [February 1, 2019, 1:42pm UTC](https://discuss.elastic.co/t/elasticsearch-should-query-combining-multiple-clauses/162964/2 "2019-02-01T13:42:30Z")

</div>

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