# Can I filter an array in elastic?

**URL:** <https://discuss.elastic.co/t/can-i-filter-an-array-in-elastic/262198>\
**Category:** Elasticsearch\
**Created:** [January 26, 2021, 7:27am UTC](https://discuss.elastic.co/t/can-i-filter-an-array-in-elastic/262198 "2021-01-26T07:27:51Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![kavierkoo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kavierkoo/32/86555_2.png) [@kavierkoo](https://discuss.elastic.co/u/kavierkoo)\
**Post date:** [January 26, 2021, 8:00am UTC](https://discuss.elastic.co/t/can-i-filter-an-array-in-elastic/262198/2 "2021-01-26T08:00:45Z")

</div>

Using bool's Should or Must allow you to use match multiple time

> **[Boolean query | Elasticsearch Guide \[8.11\] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-bool-query.html)**

An example here by @ [reswob](https://discuss.elastic.co/u/reswob)

> [@Search multiple values against multiple fields](https://discuss.elastic.co/t/search-multiple-values-against-multiple-fields/137980/2):
>
> Hmm, after some more reading and googling, it looks like the following will work: GET index/\_search { "query" : { "bool" : { "should" : [{"terms" : { "user" : ["john", "jack", "bill"]}}, {"terms" : { "fullname" : ["john", "jack", "bill"]}}, {"terms" : { "firstname" : ["john", "jack", "bill"]}} ] } } }

Hope this help to answer your questions.

---

_[View the full topic](https://discuss.elastic.co/t/can-i-filter-an-array-in-elastic/262198)._
