# Context for clauses inside "must" parameter

**URL:** <https://discuss.elastic.co/t/context-for-clauses-inside-must-parameter/253628>\
**Category:** Elasticsearch\
**Created:** [October 29, 2020, 1:45am UTC](https://discuss.elastic.co/t/context-for-clauses-inside-must-parameter/253628 "2020-10-29T01:45:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![shekharshan](https://avatars.discourse-cdn.com/v4/letter/s/53a042/32.png) [@shekharshan](https://discuss.elastic.co/u/shekharshan)\
**Post date:** [October 29, 2020, 1:45am UTC](https://discuss.elastic.co/t/context-for-clauses-inside-must-parameter/253628/1 "2020-10-29T01:45:00Z")

</div>

I was reading Elasticsearch documentation here: [https://www.elastic.co/guide/en/elasticsearch/reference/6.8/query-filter-context.html](https://www.elastic.co/guide/en/elasticsearch/reference/6.8/query-filter-context.html)

The page gives an example of a query like so:

```
curl -X GET "localhost:9200/_search?pretty" -H 'Content-Type: application/json' -d'
{
    "query": { 
        "bool": { 
            "must": [
                { "match": { "title": "Search" }},
                { "match": { "content": "Elasticsearch" }}
           ],
           "filter": [ 
               { "term": { "status": "published" }},
               { "range": { "publish_date": { "gte": "2015-01-01" }}}
           ]
         }
    }
}
'

```

The document then states the following:

**The 'bool' and two 'match' clauses are used in query context, which means that they are used to score how well each document matches.**

My confusion is stemming from the fact that the two 'match' clauses are enclosed in a 'must' parameter, which should make the context of the 'match' clauses as _filter_ and not query context. I would really appreciate if someone can clarify my confusion.

---

<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:** [November 26, 2020, 1:45am UTC](https://discuss.elastic.co/t/context-for-clauses-inside-must-parameter/253628/2 "2020-11-26T01:45:04Z")

</div>

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