# Phrase Match Query Problem

**URL:** <https://discuss.elastic.co/t/phrase-match-query-problem/18365>\
**Category:** Elasticsearch\
**Created:** [June 27, 2014, 8:38am UTC](https://discuss.elastic.co/t/phrase-match-query-problem/18365 "2014-06-27T08:38:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![kayngee](https://avatars.discourse-cdn.com/v4/letter/k/43a26b/32.png) [@kayngee](https://discuss.elastic.co/u/kayngee)\
**Post date:** [June 27, 2014, 8:38am UTC](https://discuss.elastic.co/t/phrase-match-query-problem/18365/1 "2014-06-27T08:38:39Z")

</div>

Hi Guys,

For some reason when I do the following Phrase Match query I do not get any  
results does anyone mind explaining why this is happening?

Below one can find the mapping and query being used

"settings": {

> ```
> "analysis": {
> 
> "filter": {
> 
> "token_ngrams": {
> 
> "min_shingle_size": 2,
> 
> "max_shingle_size": 4,
> 
> "type": "shingle"
> 
> },
> 
> "synoynm_filter": {
> 
> "synonyms_path": ".. path ...",
> 
> "type": "synonym"
> 
> }
> 
> },
> 
> "analyzer": {
> 
> "title_analyzer": {
> 
> "filter": ["standard", "lowercase", "asciifolding", 
> 
> ```
> 
> > "synoynm\_filter", "porter\_stem", "token\_ngrams"],
> 
> ```
> "type": "custom",
> 
> "tokenizer": "standard"
> 
> }
> 
> }
> 
> }
> 
> ```
> 
> }
> 
> "match": {
> 
> ```
> "_all": {
> 
> "query": "CompassMD is a SaaS platform",
> 
> "type": "phrase",
> 
> "analyzer": "title_analyzer"
> 
> }
> 
> ```
> 
> }

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/86a59b42-8e7d-4a37-a2ab-91f2e85fb7e8%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/86a59b42-8e7d-4a37-a2ab-91f2e85fb7e8%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![kayngee](https://avatars.discourse-cdn.com/v4/letter/k/43a26b/32.png) [@kayngee](https://discuss.elastic.co/u/kayngee)\
**Post date:** [June 27, 2014, 11:57am UTC](https://discuss.elastic.co/t/phrase-match-query-problem/18365/2 "2014-06-27T11:57:16Z")

</div>

So I did some more digging into the problem and apparently the problem is  
not with the Phase Query but with the Analyser being user on the \_all  
field. When an Analyser is specified no results are returned but when I  
omit the Analyser I get the expected results.

So the question is what is exactly happening internally on the \_all field  
is it using the standard analyser? is it not analysed?

On Friday, 27 June 2014 10:38:39 UTC+2, Shawn Ritchie wrote:

> Hi Guys,
> 
> For some reason when I do the following Phrase Match query I do not get  
> any results does anyone mind explaining why this is happening?
> 
> Below one can find the mapping and query being used
> 
> "settings": {
> 
> > ```
> > "analysis": {
> > 
> > "filter": {
> > 
> > "token_ngrams": {
> > 
> > "min_shingle_size": 2,
> > 
> > "max_shingle_size": 4,
> > 
> > "type": "shingle"
> > 
> > },
> > 
> > "synoynm_filter": {
> > 
> > "synonyms_path": ".. path ...",
> > 
> > "type": "synonym"
> > 
> > }
> > 
> > },
> > 
> > "analyzer": {
> > 
> > "title_analyzer": {
> > 
> > "filter": ["standard", "lowercase", "asciifolding", 
> > 
> > ```
> > 
> > > "synoynm\_filter", "porter\_stem", "token\_ngrams"],
> > 
> > ```
> > "type": "custom",
> > 
> > "tokenizer": "standard"
> > 
> > }
> > 
> > }
> > 
> > }
> > 
> > ```
> > 
> > }
> > 
> > "match": {
> > 
> > ```
> > "_all": {
> > 
> > "query": "CompassMD is a SaaS platform",
> > 
> > "type": "phrase",
> > 
> > "analyzer": "title_analyzer"
> > 
> > }
> > 
> > ```
> > 
> > }

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/4cf8962d-d18c-4ee8-964e-7f85882e1549%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/4cf8962d-d18c-4ee8-964e-7f85882e1549%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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, 1:19am UTC](https://discuss.elastic.co/t/phrase-match-query-problem/18365/3 "2017-07-06T01:19:18Z")

</div>


