# Match phrase prefix not resulting based on exact match

**URL:** <https://discuss.elastic.co/t/match-phrase-prefix-not-resulting-based-on-exact-match/2559>\
**Category:** Elasticsearch\
**Created:** [June 12, 2015, 11:05am UTC](https://discuss.elastic.co/t/match-phrase-prefix-not-resulting-based-on-exact-match/2559 "2015-06-12T11:05:58Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rajeshchinnam1985](https://avatars.discourse-cdn.com/v4/letter/r/c77e96/32.png) [@rajeshchinnam1985](https://discuss.elastic.co/u/rajeshchinnam1985)\
**Post date:** [June 12, 2015, 11:05am UTC](https://discuss.elastic.co/t/match-phrase-prefix-not-resulting-based-on-exact-match/2559/1 "2015-06-12T11:05:58Z")

</div>

Hi,

I am using match phrase prefix for auto suggestion for \_all  
Eg: I do have entries in my type such as "PIPE","TUBE PIPE"  
and when I am doing search using "PIPE" both are resulting but "TUBE PIPE" is getting highest score and resulting on top  
I am expecting PIPE to come first

Below are the settings for my index

"settings" : {  
"index" : {  
"analysis" : {  
"filter" : {  
"nGram\_filter" : {  
"token\_chars" : ["letter", "digit", "punctuation"],  
"min\_gram" : "1",  
"type" : "nGram",  
"max\_gram" : "20"  
}  
},  
"analyzer" : {  
"desc\_analyzer" : {  
"type" : "custom",  
"filter" : ["lowercase", "asciifolding", "nGram\_filter"],  
"tokenizer" : "keyword"  
},  
"nGram\_analyzer" : {  
"filter" : ["lowercase", "asciifolding", "nGram\_filter"],  
"type" : "custom",  
"tokenizer" : "whitespace"  
}  
}  
}

query:

"query": {  
"match\_phrase\_prefix": {  
"\_all": {  
"query": "PIPE",  
"analyzer" : "standard"  
}  
}  
}

Could you please suggest on this.

Thanks,  
Rajesh

---

<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, 12:07am UTC](https://discuss.elastic.co/t/match-phrase-prefix-not-resulting-based-on-exact-match/2559/2 "2017-07-06T00:07:54Z")

</div>


