# Difference between "text" AND query and "bool" MUST query

**URL:** https://discuss.elastic.co/t/difference-between-text-and-query-and-bool-must-query/7960
**Category:** Elasticsearch
**Created:** [June 4, 2012, 9:29am UTC](https://discuss.elastic.co/t/difference-between-text-and-query-and-bool-must-query/7960 "2012-06-04T09:29:30Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Nitish\_Sharma](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nitish_sharma/32/2626_2.png) [@Nitish\_Sharma](https://discuss.elastic.co/u/Nitish_Sharma)
#### Post date: [June 4, 2012, 9:29am UTC](https://discuss.elastic.co/t/difference-between-text-and-query-and-bool-must-query/7960/1 "2012-06-04T09:29:30Z")

</div>

Hi,  
While performing some tests to check how ES behaves if one of the query  
keywords is a stop word (for e.g. the), I came across a weird behaviour. If  
I perform a "text" AND query for "The queen" (looks like  
[https://gist.github.com/2867311](https://gist.github.com/2867311)) then I get some results back. But  
performing a bool query with must clause for "the" and "queen" does not  
return any results ([https://gist.github.com/2867307](https://gist.github.com/2867307)).  
In my understanding, a text AND query can be directly mapped to a bool MUST  
query. Apparently, that is not the case.  
Is this an expected behaviour of ES?

Cheers  
Nitish

---

<div class="post-metadata">

### Author: ![Igor\_Motov](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/igor_motov/32/45193_2.png) [@Igor\_Motov](https://discuss.elastic.co/u/Igor_Motov)
#### Post date: [June 4, 2012, 1:58pm UTC](https://discuss.elastic.co/t/difference-between-text-and-query-and-bool-must-query/7960/2 "2012-06-04T13:58:31Z")

</div>

In the first case, the stop word is getting dropped during parsing and your  
query is translated into text:queen, which returns results.

In the second case the first part is translated into special MatchNoDocs  
boolean query that returns no results, and then it is combined  
with +(text:queen user\_name:queen) using AND operator. As a result the  
combined query returns no results.

On Monday, June 4, 2012 5:29:30 AM UTC-4, Nitish Sharma wrote:

> Hi,  
> While performing some tests to check how ES behaves if one of the query  
> keywords is a stop word (for e.g. the), I came across a weird behaviour. If  
> I perform a "text" AND query for "The queen" (looks like  
> [ES text AND query · GitHub](https://gist.github.com/2867311)) then I get some results back. But  
> performing a bool query with must clause for "the" and "queen" does not  
> return any results ([ES must query · GitHub](https://gist.github.com/2867307)).  
> In my understanding, a text AND query can be directly mapped to a bool  
> MUST query. Apparently, that is not the case.  
> Is this an expected behaviour of ES?
> 
> Cheers  
> Nitish

---

<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: [July 6, 2017, 3:25am UTC](https://discuss.elastic.co/t/difference-between-text-and-query-and-bool-must-query/7960/3 "2017-07-06T03:25:42Z")

</div>


