# Trying to breakdown query into ES query

**URL:** <https://discuss.elastic.co/t/trying-to-breakdown-query-into-es-query/104625>\
**Category:** Elasticsearch\
**Created:** [October 19, 2017, 9:30pm UTC](https://discuss.elastic.co/t/trying-to-breakdown-query-into-es-query/104625 "2017-10-19T21:30:06Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ryan\_T](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ryan_t/32/23217_2.png) [@Ryan\_T](https://discuss.elastic.co/u/Ryan_T)\
**Post date:** [October 19, 2017, 9:30pm UTC](https://discuss.elastic.co/t/trying-to-breakdown-query-into-es-query/104625/1 "2017-10-19T21:30:07Z")

</div>

hey all,

Needed some help.

Im trying to do some query type stuff with ES, and wanted to know if it would even be possible, if so, how would I accomplish something like this.

`SELECT * FROM Tickets WHERE (status = open AND queue = support) AND (email = *@1234.com OR email = *@67890.com OR last_response >= 15 minutes)`

or

`SELECT * FROM Tickets WHERE (status = closed AND queue = help) OR (status = open AND queue = support)`

---

<div class="post-metadata">

**Author:** ![thiago](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/thiago/32/32096_2.png) [@thiago](https://discuss.elastic.co/u/thiago)\
**Post date:** [October 22, 2017, 9:01pm UTC](https://discuss.elastic.co/t/trying-to-breakdown-query-into-es-query/104625/2 "2017-10-22T21:01:58Z")

</div>

There are a few ways to translate that into an Elasticsearch query, but the simplest way is to start with [Query String Query](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-query-string-query.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:** [November 19, 2017, 9:02pm UTC](https://discuss.elastic.co/t/trying-to-breakdown-query-into-es-query/104625/3 "2017-11-19T21:02:06Z")

</div>

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