# Match\_phrase\_prefix different behavior in 6.7.0

**URL:** https://discuss.elastic.co/t/match-phrase-prefix-different-behavior-in-6-7-0/202844
**Category:** Elasticsearch
**Created:** [October 9, 2019, 2:20pm UTC](https://discuss.elastic.co/t/match-phrase-prefix-different-behavior-in-6-7-0/202844 "2019-10-09T14:20:49Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![bdelbosc](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bdelbosc/32/32980_2.png) [@bdelbosc](https://discuss.elastic.co/u/bdelbosc)
#### Post date: [October 9, 2019, 2:20pm UTC](https://discuss.elastic.co/t/match-phrase-prefix-different-behavior-in-6-7-0/202844/1 "2019-10-09T14:20:50Z")

</div>

Hi,  
I have a different search result when upgrading from 6.6.2 to 6.7.0.  
It looks like that since 6.7.0 a match\_phrase\_prefix query is now able to match a keyword field.  
I have read the changelog of 6.7 but I don't find a reason for this, here is a script to reproduce the problem:

> <https://gist.github.com/bdelbosc/8ef2f6edcde641826096ae8096849b63>

Thanks for your help,  
Regards  
ben

---

<div class="post-metadata">

### Author: ![bdelbosc](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bdelbosc/32/32980_2.png) [@bdelbosc](https://discuss.elastic.co/u/bdelbosc)
#### Post date: [October 11, 2019, 7:11am UTC](https://discuss.elastic.co/t/match-phrase-prefix-different-behavior-in-6-7-0/202844/2 "2019-10-11T07:11:08Z")

</div>

Hi, clearly match\_phrase\_prefix is now able to search on keyword field.  
This new behavior should be noticed somewhere in the Elasticsearch 6.7.0 changes and in the documentation.  
I didn't find anything in the Lucene changelog between 7.6.0 (Elaticsearch 6.6.2) and 7.7.0 (Elasticsearch 6.7.0).  
Regards  
ben

---

<div class="post-metadata">

### Author: ![bdelbosc](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bdelbosc/32/32980_2.png) [@bdelbosc](https://discuss.elastic.co/u/bdelbosc)
#### Post date: [October 11, 2019, 8:02am UTC](https://discuss.elastic.co/t/match-phrase-prefix-different-behavior-in-6-7-0/202844/3 "2019-10-11T08:02:22Z")

</div>

Just to give more context, I am not saying that applying a match\_phrase operation to a keyword field is a good idea.  
Previously it wasn't working and it was clear that the mapping needed to be updated.  
Since 6.7 it gives the impression that it works so we loose the "fail fast" effect.

---

<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 8, 2019, 8:02am UTC](https://discuss.elastic.co/t/match-phrase-prefix-different-behavior-in-6-7-0/202844/4 "2019-11-08T08:02:26Z")

</div>

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