# Overlapping words in phrases in bool must, returning no result

**URL:** <https://discuss.elastic.co/t/overlapping-words-in-phrases-in-bool-must-returning-no-result/158361>\
**Category:** Elasticsearch\
**Created:** [November 27, 2018, 2:51pm UTC](https://discuss.elastic.co/t/overlapping-words-in-phrases-in-bool-must-returning-no-result/158361 "2018-11-27T14:51:17Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Danielss89](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/danielss89/32/38133_2.png) [@Danielss89](https://discuss.elastic.co/u/Danielss89)\
**Post date:** [November 27, 2018, 2:51pm UTC](https://discuss.elastic.co/t/overlapping-words-in-phrases-in-bool-must-returning-no-result/158361/1 "2018-11-27T14:51:17Z")

</div>

Hello

I have this document: "a nice fox and an ugly fox"

Now i want it to match with this query MUST HAVE "a nice fox" AND MUST HAVE "an ugly fox". So i have the following query: [https://codebeautify.org/jsonviewer/cbf77a45](https://codebeautify.org/jsonviewer/cbf77a45)  
But this doesn't match the document. The funny thing is, if the phrases doesn't "overlap" in words, meaning not containing any of the words which are in the other phrase, then it works.  
F.x. this query, which works: [https://codebeautify.org/jsonviewer/cb4ff8f4](https://codebeautify.org/jsonviewer/cb4ff8f4) (i removed "fox" from "an ugly fox".

What am i doing wrong?

---

<div class="post-metadata">

**Author:** ![Danielss89](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/danielss89/32/38133_2.png) [@Danielss89](https://discuss.elastic.co/u/Danielss89)\
**Post date:** [November 28, 2018, 12:51pm UTC](https://discuss.elastic.co/t/overlapping-words-in-phrases-in-bool-must-returning-no-result/158361/2 "2018-11-28T12:51:25Z")

</div>

Here is a gist with some json data for reproduction: [https://gist.github.com/Danielss89/6d8f14d613503008e7da67d596a195e9](https://gist.github.com/Danielss89/6d8f14d613503008e7da67d596a195e9)

---

<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:** [December 26, 2018, 12:51pm UTC](https://discuss.elastic.co/t/overlapping-words-in-phrases-in-bool-must-returning-no-result/158361/3 "2018-12-26T12:51:27Z")

</div>

Closed on December 26, 2018, 12:51pm UTC

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