> For the complete documentation index, see [llms.txt](https://docs.hyper-space.io/hyperspace-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.hyper-space.io/hyperspace-docs/api-documentation/dsl-query-framework/bool-queries/filter-clause.md).

# 'filter' Clause

The `filter` clause within a `bool` query specifies conditions that are mandatory for a document to be considered a match, in a similar manner to `'must'` clause. Unlike the `must` clause, the `filter` clause does not affect the document score.

**Example -**

```json
{
  "query": {
    "bool": {
      "must": 
        { "term": { "Bird": "Asian Koel" } }
      ,
      "filter": [
        { "term": { "Country": "India" } },
        { "term": { "Color": "Black" } }
      ]
    }
  }
}
```

In the above example, all candidates must satisfy the condition -

* exact match over the 'bird' field, with score equals TF-IDF score for { "Bird": "Asian Koel" }

In addition, any matched documents must satisfy the following conditions -

* exact match over the 'Country' field, with score equals TF-IDF score for { "Bird": "Asian Koel" }
* exact match over "Color" field, with score equals TF-IDF score for { "In Stock": "true" }

The overall score will be the rarity score, determined by the `"must": { "term": { "Bird": "Asian Koel" } }` clause.
