# How to search (query or filter) on an integer array field

**URL:** <https://discuss.elastic.co/t/how-to-search-query-or-filter-on-an-integer-array-field/246526>\
**Category:** Elasticsearch\
**Created:** [August 27, 2020, 12:27am UTC](https://discuss.elastic.co/t/how-to-search-query-or-filter-on-an-integer-array-field/246526 "2020-08-27T00:27:11Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![taichi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/taichi/32/46431_2.png) [@taichi](https://discuss.elastic.co/u/taichi)\
**Post date:** [August 27, 2020, 12:27am UTC](https://discuss.elastic.co/t/how-to-search-query-or-filter-on-an-integer-array-field/246526/1 "2020-08-27T00:27:11Z")

</div>

I have a document mapping like this:

```
{
    "id": 1,
    "some_category_ids": [1, 2, 3]
}

```

I would like to search documents which includes specified category\_ids.  
For example, when I specify in query `"some_category_ids": [2, 3]` , I want to get documents which has some\_category\_ids `2 or 3`.

It does not work with query like this:

```
{
    "query": {
        { "match": { "some_category_ids": [2, 3] } }
    }
}

```

How to achieve what I want?

---

<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:** [September 24, 2020, 12:27am UTC](https://discuss.elastic.co/t/how-to-search-query-or-filter-on-an-integer-array-field/246526/2 "2020-09-24T00:27:12Z")

</div>

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