# How to write query for this case?

**URL:** <https://discuss.elastic.co/t/how-to-write-query-for-this-case/150649>\
**Category:** Elasticsearch\
**Created:** [October 2, 2018, 6:18am UTC](https://discuss.elastic.co/t/how-to-write-query-for-this-case/150649 "2018-10-02T06:18:01Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ali\_houshyaripour](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ali_houshyaripour/32/35931_2.png) [@ali\_houshyaripour](https://discuss.elastic.co/u/ali_houshyaripour)\
**Post date:** [October 2, 2018, 6:18am UTC](https://discuss.elastic.co/t/how-to-write-query-for-this-case/150649/1 "2018-10-02T06:18:01Z")

</div>

I want to write a query which contains these three sections:

- a condition check like this: if ((A || B || C) && (D || E || F)) that each one of A, B, C and ... are a simple match term query
- several boolean filter like is\_delete, is\_ad and ...
- a nested query that check match term for one of nested object's parameters

But I don't know how to write it, anyone can help me?

---

<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:** [October 30, 2018, 6:18am UTC](https://discuss.elastic.co/t/how-to-write-query-for-this-case/150649/2 "2018-10-30T06:18:10Z")

</div>

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