# Query assistance for conditional querying

**URL:** https://discuss.elastic.co/t/query-assistance-for-conditional-querying/356218
**Category:** Elasticsearch
**Tags:** eql-elastic-query-language
**Created:** [March 27, 2024, 3:47am UTC](https://discuss.elastic.co/t/query-assistance-for-conditional-querying/356218 "2024-03-27T03:47:00Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Spandana](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spandana/32/133011_2.png) [@Spandana](https://discuss.elastic.co/u/Spandana)
#### Post date: [March 27, 2024, 3:47am UTC](https://discuss.elastic.co/t/query-assistance-for-conditional-querying/356218/1 "2024-03-27T03:47:00Z")

</div>

I have elastic index with fields styleId, sellingStyleId, styleName, inventoryEnabled, inventoryCount

need help with query to pull all the records but if inventoryEnabled is true then check if inventoryCount is greater than 10 else if inventoryEnabled is not true or null then pick that record and do not check for inventoryCount

---

<div class="post-metadata">

### Author: ![Abhilash\_B](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/abhilash_b/32/40270_2.png) [@Abhilash\_B](https://discuss.elastic.co/u/Abhilash_B)
#### Post date: [March 27, 2024, 3:52am UTC](https://discuss.elastic.co/t/query-assistance-for-conditional-querying/356218/2 "2024-03-27T03:52:22Z")

</div>

I don't think there is a way to pipeline queries in Elasticsearch. Maybe you can take a look at [multi search API](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-multi-search.html) and collate the responses in the backend outside of Elasticsearch

---

<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: [April 24, 2024, 3:52am UTC](https://discuss.elastic.co/t/query-assistance-for-conditional-querying/356218/3 "2024-04-24T03:52:36Z")

</div>

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