# Search Operators

**URL:** <https://discuss.elastic.co/t/search-operators/104012>\
**Category:** Elasticsearch\
**Created:** [October 15, 2017, 4:22am UTC](https://discuss.elastic.co/t/search-operators/104012 "2017-10-15T04:22:31Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Illidan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/illidan/32/54264_2.png) [@Illidan](https://discuss.elastic.co/u/Illidan)\
**Post date:** [October 15, 2017, 4:22am UTC](https://discuss.elastic.co/t/search-operators/104012/1 "2017-10-15T04:22:32Z")

</div>

I trying to achieve behavior similar to using Google search operators. For instance, Google supports "AND", and "OR" operators as part of query string, in order to produce more refined searches. For example:

"Junior AND Developers" --\> will return results which include both terms (junior and developer/s)

"Junior OR Developers) --\>will return results which include any of provided terms (junior or developer/s)

Or, in Google, term provided in quotes searched "as-is" (e.g. exact match).

Is there similar functionality in Elasticsearch? What is default behavior in Elasticsearch? (e.g. what exactly happens when I search for "Junior Developers" (e.g. white-space between terms)?

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [October 15, 2017, 4:56am UTC](https://discuss.elastic.co/t/search-operators/104012/2 "2017-10-15T04:56:26Z")

</div>

Check out [https://www.elastic.co/guide/en/elasticsearch/guide/2.x/search.html](https://www.elastic.co/guide/en/elasticsearch/guide/2.x/search.html), it's still valid for 5.X.

---

<div class="post-metadata">

**Author:** ![Illidan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/illidan/32/54264_2.png) [@Illidan](https://discuss.elastic.co/u/Illidan)\
**Post date:** [October 15, 2017, 12:51pm UTC](https://discuss.elastic.co/t/search-operators/104012/3 "2017-10-15T12:51:22Z")

</div>

I reviewed documentation, thank you.

So, if I understand correctly, it is my responsibility to parse user input and to build based on it ES query? Is there any built-in parser? It's not trivial at all to parse complex statements (e.g. combinations of "OR" and "AND" blocks).

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [October 17, 2017, 4:09am UTC](https://discuss.elastic.co/t/search-operators/104012/4 "2017-10-17T04:09:25Z")

</div>

> [@Illidan](#):
>
> So, if I understand correctly, it is my responsibility to parse user input and to build based on it ES query?

If that is what your users are expecting, then yes.

---

<div class="post-metadata">

**Author:** ![Illidan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/illidan/32/54264_2.png) [@Illidan](https://discuss.elastic.co/u/Illidan)\
**Post date:** [October 20, 2017, 4:11am UTC](https://discuss.elastic.co/t/search-operators/104012/5 "2017-10-20T04:11:56Z")

</div>

Actually I discovered that 'QueryString' does exactly what I need (e.g. parsing string expression).

---

<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 17, 2017, 4:26am UTC](https://discuss.elastic.co/t/search-operators/104012/6 "2017-11-17T04:26:15Z")

</div>

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