# Match\_phrase\_prefix NOT working as expected for other languages

**URL:** https://discuss.elastic.co/t/match-phrase-prefix-not-working-as-expected-for-other-languages/175672
**Category:** Elasticsearch
**Created:** [April 6, 2019, 9:58am UTC](https://discuss.elastic.co/t/match-phrase-prefix-not-working-as-expected-for-other-languages/175672 "2019-04-06T09:58:47Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![kasiselvamk](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kasiselvamk/32/43595_2.png) [@kasiselvamk](https://discuss.elastic.co/u/kasiselvamk)
#### Post date: [April 6, 2019, 9:58am UTC](https://discuss.elastic.co/t/match-phrase-prefix-not-working-as-expected-for-other-languages/175672/1 "2019-04-06T09:58:47Z")

</div>

> <https://github.com/elastic/elasticsearch/issues/40907>

**Elasticsearch version** ( `bin/elasticsearch --version` ): latest version

**Plugins installed** : [NA]

**JVM version** ( `java -version` ):1.8

**OS version** ( `uname -a` if on a Unix-like system): ubuntu-latest

**Description of the problem including expected versus actual behavior** :

match\_phrase\_prefix NOT working as expected for other languages  
when in insert below words;  
"word" : "க்ஷுத்ரஸ்வாஸம்"  
"word" : "க்ஷேத்திரம்"  
"word" : "க்ஷேமதண்டுலம்"  
**and try to search with character "க்" it is returning above word's --\> which is not expected.  
Please follow below easy step to reproduce,  
please help on how to resolve this issue.....**  
example:-  
"க்ஷேத்திரம்" --\>unicode rep.  
க  
்  
ஷ  
ே  
த  
்  
த  
ி  
ர  
ம  
்  
**Steps to reproduce** :

**Please include a _minimal_ but _complete_ recreation of the problem, including  
(e.g.) index creation, mappings, settings, query etc. The easier you make for  
us to reproduce it, the more likely that somebody will take the time to look at it.**

1. create index as given.  
2.insert data  
3.run search
2. create index as given.

PUT /tamil\_example  
{  
"settings": {  
"analysis": {  
"filter": {  
"tamil\_stop": {  
"type": "stop",  
"stopwords": " _none_ "  
},  
"tamil\_keywords": {  
"type": "keyword\_marker",  
"keywords":   
},  
"tamil\_stemmer": {  
"type": "stemmer",  
"language": "minimal\_english"  
}  
},  
"analyzer": {  
"tamil\_analyzer": {  
"tokenizer": "standard",  
"filter": [  
"lowercase",  
"decimal\_digit",  
"tamil\_keywords",  
"indic\_normalization",  
"tamil\_stop",  
"tamil\_stemmer"  
]  
}  
}  
}  
},  
"mappings": {  
"\_doc": {  
"properties": {  
"word": {  
"type": "text",  
"analyzer": "tamil\_analyzer"  
}  
}  
}  
}  
}

2.insert data

PUT tamil\_example/\_doc/1  
{  
"word" : "க்ஷுத்ரஸ்வாஸம்"  
}  
PUT tamil\_example/\_doc/2  
{  
"word" : "க்ஷேத்திரம்"  
}  
PUT tamil\_example/\_doc/3  
{  
"word" : "க்ஷேமதண்டுலம்"  
}

3.run search :-  
GET tamil\_example/\_search  
{  
"query": {  
"match\_phrase\_prefix": {  
"word": "க்"  
}  
}  
}  
Out put ------\> Below output is NOT expected., it should return empty search.  
{  
"took" : 6,  
"timed\_out" : false,  
"\_shards" : {  
"total" : 5,  
"successful" : 5,  
"skipped" : 0,  
"failed" : 0  
},  
"hits" : {  
"total" : 3,  
"max\_score" : 0.2876821,  
"hits" : [  
{  
"\_index" : "tamil\_example",  
"\_type" : "\_doc",  
"\_id" : "2",  
"\_score" : 0.2876821,  
"\_source" : {  
"word" : "க்ஷேத்திரம்"  
}  
},  
{  
"\_index" : "tamil\_example",  
"\_type" : "\_doc",  
"\_id" : "1",  
"\_score" : 0.2876821,  
"\_source" : {  
"word" : "க்ஷுத்ரஸ்வாஸம்"  
}  
},  
{  
"\_index" : "tamil\_example",  
"\_type" : "\_doc",  
"\_id" : "3",  
"\_score" : 0.2876821,  
"\_source" : {  
"word" : "க்ஷேமதண்டுலம்"  
}  
}  
]  
}  
}

**Provide logs (if relevant)** :

---

<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: [May 4, 2019, 9:58am UTC](https://discuss.elastic.co/t/match-phrase-prefix-not-working-as-expected-for-other-languages/175672/2 "2019-05-04T09:58:48Z")

</div>

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