# Meaning must and operator combination

**URL:** <https://discuss.elastic.co/t/meaning-must-and-operator-combination/85522>\
**Category:** Elasticsearch\
**Created:** [May 12, 2017, 8:25am UTC](https://discuss.elastic.co/t/meaning-must-and-operator-combination/85522 "2017-05-12T08:25:36Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sharon\_wsf](https://avatars.discourse-cdn.com/v4/letter/s/7993a0/32.png) [@Sharon\_wsf](https://discuss.elastic.co/u/Sharon_wsf)\
**Post date:** [May 12, 2017, 8:25am UTC](https://discuss.elastic.co/t/meaning-must-and-operator-combination/85522/1 "2017-05-12T08:25:36Z")

</div>

```
POST news/bursa/_search { "query": { "bool": { "must": [{ "match": { "category": "36" } }],"must": [{ "multi_match": { "query": [ "4448.KL","6599.KL"], "fields": ["stkno", "tag" ,"content" ,"htext"] ,"operator": "and"} } ],"must": [{ "range": { "CDate": { "gt": "2010-01-01" , "lte": "2017-05-30T23:59:59" } } }] } }, "size": 1000, "sort": [{ "CDate": { "order": "desc" } }] }}

```

what meaning if must and operator combine together?  
Why it only can match 6599.KL, and 4448.KL can't find? 4448.KL and 6599.KL sure inside elasticsearch.  
If i wan search if 4448.KL also have inside the data, result also need prompt out. How should be i do?

---

<div class="post-metadata">

**Author:** ![polyfractal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/polyfractal/32/48162_2.png) [@polyfractal](https://discuss.elastic.co/u/polyfractal)\
**Post date:** [May 19, 2017, 6:24pm UTC](https://discuss.elastic.co/t/meaning-must-and-operator-combination/85522/2 "2017-05-19T18:24:42Z")

</div>

"Must" clause says that all of the clauses "must match" for the document to be a hit. E.g. it is very similar to a boolean AND: `this AND that AND theOther`

I suggest reading through the Fulltext Search chapter of the Definitive Guide for more info on how queries are constructed: [https://www.elastic.co/guide/en/elasticsearch/guide/current/full-text-search.html](https://www.elastic.co/guide/en/elasticsearch/guide/current/full-text-search.html)

In particular, this section on boolean queries: [https://www.elastic.co/guide/en/elasticsearch/guide/current/bool-query.html](https://www.elastic.co/guide/en/elasticsearch/guide/current/bool-query.html)

---

<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:** [June 16, 2017, 6:25pm UTC](https://discuss.elastic.co/t/meaning-must-and-operator-combination/85522/3 "2017-06-16T18:25:12Z")

</div>

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