# Match query doesn\`t find my string?

**URL:** <https://discuss.elastic.co/t/match-query-doesn-t-find-my-string/106267>\
**Category:** Elasticsearch\
**Created:** [November 3, 2017, 3:32am UTC](https://discuss.elastic.co/t/match-query-doesn-t-find-my-string/106267 "2017-11-03T03:32:50Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![hubo3085632](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hubo3085632/32/23724_2.png) [@hubo3085632](https://discuss.elastic.co/u/hubo3085632)\
**Post date:** [November 3, 2017, 3:32am UTC](https://discuss.elastic.co/t/match-query-doesn-t-find-my-string/106267/1 "2017-11-03T03:32:50Z")

</div>

Hi all:  
I indexed a string "3L-LEEMARK LOGISTIC LTD." using "ik" analyzer, when i use "3l" to query the string can not be find, what`s the problem?

Here is my DSL :  
"match" : {  
"name" : {  
"query" : "3l",  
"type" : "boolean",  
"operator" : "AND"  
}  
}

I tested the analyzer it output this :  
[root@ES]# curl -XPOST 192.168.1.100:9200/test/\_analyze?pretty -d '  
{ "analyzer":"ik","text":"3L-LEEMARK LOGISTIC LTD."}'  
{  
"tokens" : [ {  
"token" : "3l-leemark",  
"start\_offset" : 0,  
"end\_offset" : 10,  
"type" : "LETTER",  
"position" : 0  
}, {  
"token" : "3",  
"start\_offset" : 0,  
"end\_offset" : 1,  
"type" : "ARABIC",  
"position" : 1  
}, {  
"token" : "l",  
"start\_offset" : 1,  
"end\_offset" : 2,  
"type" : "ENGLISH",  
"position" : 2  
}, {  
"token" : "leemark",  
"start\_offset" : 3,  
"end\_offset" : 10,  
"type" : "ENGLISH",  
"position" : 3  
}, {  
"token" : "logistic",  
"start\_offset" : 11,  
"end\_offset" : 19,  
"type" : "ENGLISH",  
"position" : 4  
}, {  
"token" : "ltd.",  
"start\_offset" : 20,  
"end\_offset" : 24,  
"type" : "LETTER",  
"position" : 5  
}, {  
"token" : "ltd",  
"start\_offset" : 20,  
"end\_offset" : 23,  
"type" : "ENGLISH",  
"position" : 6  
} ]  
}

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [November 3, 2017, 2:49pm UTC](https://discuss.elastic.co/t/match-query-doesn-t-find-my-string/106267/2 "2017-11-03T14:49:10Z")

</div>

can you provide a full example, including index/mapping creation and a sample document you are indexing? That would help others to reproduce your issue tremendously.

--Alex

---

<div class="post-metadata">

**Author:** ![hubo3085632](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hubo3085632/32/23724_2.png) [@hubo3085632](https://discuss.elastic.co/u/hubo3085632)\
**Post date:** [November 13, 2017, 5:47am UTC](https://discuss.elastic.co/t/match-query-doesn-t-find-my-string/106267/3 "2017-11-13T05:47:00Z")

</div>

thank you for your reply, i described not detailed, i add more details.  
The Map :  
XContentBuilder builder = XContentFactory.jsonBuilder()  
.startObject()  
.startObject("properties")  
.startObject("ID".toLowerCase()).field("type", "long").endObject()  
.startObject("Name".toLowerCase()).field("type","string").field("index","analyzed").field("analyzer","ik").endObject()  
.endObject()  
.endObject();

The doc :{"id":1,"name":"3L-LEEMARK LOGISTICS LTD."}

The Query:QueryBuilders.matchQuery("name","3l").operator(MatchQueryBuilder.Operator.AND);

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [November 13, 2017, 8:15am UTC](https://discuss.elastic.co/t/match-query-doesn-t-find-my-string/106267/4 "2017-11-13T08:15:52Z")

</div>

This is not a full example, it is still missing the index settings/mapping/analyzers. Full recreation is really important here.

See [https://www.elastic.co/help](https://www.elastic.co/help)

---

<div class="post-metadata">

**Author:** ![hubo3085632](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hubo3085632/32/23724_2.png) [@hubo3085632](https://discuss.elastic.co/u/hubo3085632)\
**Post date:** [November 13, 2017, 9:23am UTC](https://discuss.elastic.co/t/match-query-doesn-t-find-my-string/106267/5 "2017-11-13T09:23:15Z")

</div>

{  
"filing" : {  
"aliases" : {  
"customer" : { }  
},  
"mappings" : {  
"customer" : {  
"properties" : {  
"id" : {  
"type" : "integer"  
},  
"name" : {  
"type" : "string",  
"analyzer" : "ik"  
}  
}  
}  
},  
"settings" : {  
"index" : {  
"creation\_date" : "1489556968108",  
"number\_of\_shards" : "20",  
"number\_of\_replicas" : "1",  
"uuid" : "\_U2kKcgfT46wzVeuA-pAMQ",  
"version" : {  
"created" : "2030599"  
}  
}  
},  
"warmers" : { }  
}  
}

the IK analyzer is a plugin for Analysising Chinese

---

<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 11, 2017, 9:23am UTC](https://discuss.elastic.co/t/match-query-doesn-t-find-my-string/106267/6 "2017-12-11T09:23:29Z")

</div>

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