# Search where both filters match

**URL:** <https://discuss.elastic.co/t/search-where-both-filters-match/151682>\
**Category:** Elasticsearch\
**Created:** [October 9, 2018, 4:13pm UTC](https://discuss.elastic.co/t/search-where-both-filters-match/151682 "2018-10-09T16:13:17Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![arielperez](https://avatars.discourse-cdn.com/v4/letter/a/f07891/32.png) [@arielperez](https://discuss.elastic.co/u/arielperez)\
**Post date:** [October 9, 2018, 4:13pm UTC](https://discuss.elastic.co/t/search-where-both-filters-match/151682/1 "2018-10-09T16:13:17Z")

</div>

I am doing a search with elasticSearch but I would like to filter it and the search must match both filters.

this is the code:

```
"query" => [
								"bool" => [
	            					"must" => [
				  						'multi_match'=> [
							          		'query'=> $this->input->get('search'),
							          		'fields'=> ["title^2", "description"]
				        				]
				        			],
				        			"filter" => [
								  		"terms" => [ 
								  			"Categories" => ['Featured Works']
								  		],
								  		"terms" => [
								  			"Tags" => ['Merida']
								  		]
								  	]
				        		]
							]

```

Bring the search results but take the filter as an OR and I would like an AND

---

<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 6, 2018, 4:13pm UTC](https://discuss.elastic.co/t/search-where-both-filters-match/151682/2 "2018-11-06T16:13:18Z")

</div>

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