# Search with multiple conditions

**URL:** <https://discuss.elastic.co/t/search-with-multiple-conditions/240144>\
**Category:** Elasticsearch\
**Created:** [July 7, 2020, 10:32am UTC](https://discuss.elastic.co/t/search-with-multiple-conditions/240144 "2020-07-07T10:32:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mdiakhate](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mdiakhate/32/71723_2.png) [@mdiakhate](https://discuss.elastic.co/u/mdiakhate)\
**Post date:** [July 7, 2020, 10:32am UTC](https://discuss.elastic.co/t/search-with-multiple-conditions/240144/1 "2020-07-07T10:32:36Z")

</div>

Hello,

I have a very simple problem that I would like to translate into an ES search.  
I have different items with 2 fields : registration\_label which is a string and is\_optam is a bool.

My query in SQL would be something like :

`SELECT * from practitioner where (registration_label = 'c1' and is_optam = 1) OR (registration_label = 'c1' and is_optam = 0) OR (registration_label = 'c2' and is_optam = 1) OR (registration_label = 'c2' and is_optam = 0) OR (registration_label = 'c3' and is_optam = 0) ;`

How could i translate this into ES ?

Many thanks

---

<div class="post-metadata">

**Author:** ![Vinayak\_Sapre](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vinayak_sapre/32/45939_2.png) [@Vinayak\_Sapre](https://discuss.elastic.co/u/Vinayak_Sapre)\
**Post date:** [July 7, 2020, 7:15pm UTC](https://discuss.elastic.co/t/search-with-multiple-conditions/240144/2 "2020-07-07T19:15:34Z")

</div>

Try this

[https://www.elastic.co/guide/en/elasticsearch/reference/current/sql-translate.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/sql-translate.html)

---

<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:** [August 4, 2020, 7:15pm UTC](https://discuss.elastic.co/t/search-with-multiple-conditions/240144/3 "2020-08-04T19:15:51Z")

</div>

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