# Search for 2 key words in a single query

**URL:** <https://discuss.elastic.co/t/search-for-2-key-words-in-a-single-query/205679>\
**Category:** Elastic Search\
**Tags:** elastic-app-search\
**Created:** [October 29, 2019, 1:35pm UTC](https://discuss.elastic.co/t/search-for-2-key-words-in-a-single-query/205679 "2019-10-29T13:35:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![teja\_sri](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/teja_sri/32/55614_2.png) [@teja\_sri](https://discuss.elastic.co/u/teja_sri)\
**Post date:** [October 29, 2019, 1:35pm UTC](https://discuss.elastic.co/t/search-for-2-key-words-in-a-single-query/205679/1 "2019-10-29T13:35:39Z")

</div>

Is there any way to search for 2 key words in a single query.

Eg:

[  
{  
id:1  
name:Jim,  
description:cool guy,  
employer:Delta Dental,  
address: Okemos  
},  
{  
id:2,  
name:Jim,  
description: grumpy guy,  
employer: FedEx,  
address:Memphis  
},  
{  
id:3,  
name:Jim,  
description: funny guy,  
employer: Delta Dental,  
address: Okemos  
},  
id:4,  
name:Jim,  
description: funny guy,  
employer: Delta Dental,  
address: Minnesota  
}  
]

I wanna search for user Jim, who is a cool guy, who works for DeltaDental and lives in Okemos??

I am thinking the query should be

Query:"Jim"  
"filters": {  
"all": [  
{  
description:"cool guy"  
},  
{  
employer: Delta Dental  
},  
{  
address: Okemos  
}  
]  
}

Is the above query correct?? or is there any other efficient way ?

sometimes the query could be search for user who is a cool guy, who works for DeltaDental and lives in Okemos?? In this case there is not user name specified. so what do I do now?

Is there a way for the below query??

Query:"Jim","cool guy"  
"filters": {  
"all": [  
{  
employer: Delta Dental  
},  
{  
address: Okemos  
}  
]  
}

---

<div class="post-metadata">

**Author:** ![JasonStoltz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jasonstoltz/32/49893_2.png) [@JasonStoltz](https://discuss.elastic.co/u/JasonStoltz)\
**Post date:** [October 30, 2019, 3:58pm UTC](https://discuss.elastic.co/t/search-for-2-key-words-in-a-single-query/205679/2 "2019-10-30T15:58:06Z")

</div>

Hi, I believe you can use the "AND" keyword in searches. For example: [https://search-ui-stable.netlify.com/?q=Florida%20AND%20everglades&size=n\_20\_n](https://search-ui-stable.netlify.com/?q=Florida%20AND%20everglades&size=n_20_n)

> **[Search API | Swiftype Documentation](https://swiftype.com/documentation/app-search/api/search#search-queries)**
>
> Learn how to get the most out of Swiftype

> You may also apply the following Lucene Query Syntax functions: double quoted strings, + and -, AND, OR, and NOT.

---

<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 27, 2019, 3:58pm UTC](https://discuss.elastic.co/t/search-for-2-key-words-in-a-single-query/205679/3 "2019-11-27T15:58:07Z")

</div>

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