# How to check if query applies to new document

**URL:** <https://discuss.elastic.co/t/how-to-check-if-query-applies-to-new-document/215873>\
**Category:** Elasticsearch\
**Created:** [January 21, 2020, 11:35am UTC](https://discuss.elastic.co/t/how-to-check-if-query-applies-to-new-document/215873 "2020-01-21T11:35:51Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Marcin\_Kukielka](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marcin_kukielka/32/46127_2.png) [@Marcin\_Kukielka](https://discuss.elastic.co/u/Marcin_Kukielka)\
**Post date:** [January 21, 2020, 11:35am UTC](https://discuss.elastic.co/t/how-to-check-if-query-applies-to-new-document/215873/1 "2020-01-21T11:35:51Z")

</div>

Hi,  
Is there an efficient way to check whether document will be in result set of given query?  
I have a set of queries that I need to iterate and check if the new document applies to them, in terms of filtering and searching by field value.  
I know that I can run the query and iterate through result set and check id but this seems a little bit lame.

Cheers Marcin

---

<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:** [February 18, 2020, 11:40am UTC](https://discuss.elastic.co/t/how-to-check-if-query-applies-to-new-document/215873/2 "2020-02-18T11:40:29Z")

</div>

Closed on February 18, 2020, 11:40am UTC

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