# Filter in ids query

**URL:** https://discuss.elastic.co/t/filter-in-ids-query/262902
**Category:** Elasticsearch
**Created:** [February 1, 2021, 8:40pm UTC](https://discuss.elastic.co/t/filter-in-ids-query/262902 "2021-02-01T20:40:29Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![yish-yish](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/yish-yish/32/80146_2.png) [@yish-yish](https://discuss.elastic.co/u/yish-yish)
#### Post date: [February 1, 2021, 8:40pm UTC](https://discuss.elastic.co/t/filter-in-ids-query/262902/1 "2021-02-01T20:40:29Z")

</div>

Hi elastic wizards.

I have in my code base an ids query, and I need to add filtering capabilities to the query i.e. in addition to the ids filter, I need to be able to add additional term based filters.  
Is there a way to achieve that in ids query? do I need to rewrite the query as a bool query (or any other type)? If so - What will it look like?  
I'm using elastic 7.

This is my current query (inside the "query" clause):

```auto
    ids: {
        values: [
          'id1','id2'...]
    }

```

Thanks!

---

<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: [March 1, 2021, 8:40pm UTC](https://discuss.elastic.co/t/filter-in-ids-query/262902/2 "2021-03-01T20:40:50Z")

</div>

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