# How can I set multiple search keywords as SQL AND condition?

**URL:** <https://discuss.elastic.co/t/how-can-i-set-multiple-search-keywords-as-sql-and-condition/69987>\
**Category:** Elasticsearch\
**Created:** [December 26, 2016, 9:13am UTC](https://discuss.elastic.co/t/how-can-i-set-multiple-search-keywords-as-sql-and-condition/69987 "2016-12-26T09:13:44Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![tanimoto](https://avatars.discourse-cdn.com/v4/letter/t/dec6dc/32.png) [@tanimoto](https://discuss.elastic.co/u/tanimoto)\
**Post date:** [December 26, 2016, 9:13am UTC](https://discuss.elastic.co/t/how-can-i-set-multiple-search-keywords-as-sql-and-condition/69987/1 "2016-12-26T09:13:44Z")

</div>

When I search `personal computer` → Hit the document that includes `personal OR computer`  
Can I change this condition to → Hit the document that includes `personal AND computer??`

I'm using elasticsearch 5.1.1

---

<div class="post-metadata">

**Author:** ![andrewkroh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andrewkroh/32/3784_2.png) [@andrewkroh](https://discuss.elastic.co/u/andrewkroh)\
**Post date:** [December 26, 2016, 3:49pm UTC](https://discuss.elastic.co/t/how-can-i-set-multiple-search-keywords-as-sql-and-condition/69987/2 "2016-12-26T15:49:30Z")

</div>

You can put the string in quotes to search for the exact phrase or you can specify a boolean condition like you gave using `AND`. See the [Query String Syntax](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-query-string-query.html#query-string-syntax) documenation.

---

<div class="post-metadata">

**Author:** ![tanimoto](https://avatars.discourse-cdn.com/v4/letter/t/dec6dc/32.png) [@tanimoto](https://discuss.elastic.co/u/tanimoto)\
**Post date:** [December 27, 2016, 2:12am UTC](https://discuss.elastic.co/t/how-can-i-set-multiple-search-keywords-as-sql-and-condition/69987/3 "2016-12-27T02:12:48Z")

</div>

thank you so much!!  
This is exactly what I was looking for!!!

---

<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:** [January 24, 2017, 2:13am UTC](https://discuss.elastic.co/t/how-can-i-set-multiple-search-keywords-as-sql-and-condition/69987/4 "2017-01-24T02:13:06Z")

</div>

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