> For the complete documentation index, see [llms.txt](https://dan-12.gitbook.io/elasticsearch-note/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://dan-12.gitbook.io/elasticsearch-note/elasticsearch/search/bool.md).

# Bool

### Example

get document using `and` operator

```json
GET /bank/_search
{
  "query": {
    "bool": {
      "must": [
        { "match": { "age": "40" } }
      ],
      "must_not": [
        { "match": { "state": "ID" } }
      ]
    }
  }
}
```

### References

* <https://www.elastic.co/guide/kr/elasticsearch/reference/current/gs-executing-searches.html>
* <https://www.elastic.co/guide/en/elasticsearch/reference/5.4/query-dsl-bool-query.html>
