Match query doesn`t find my string?

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
} ]
}

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

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);

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

{
"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

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