I've just tried this on Elasticsearch 2.3.0 and get the same issue. Here are the steps to reproduce
1.install smart chinese analysis plugin
sudo bin/plugin install analysis-smartcn
2.create an index
curl -XPUT "http://localhost:9200/newmall" -d'
{
"mappings": {
"mall":{
"properties": {
"text": {
"type": "string",
"analyzer": "smartcn"
}
}
}
}
}'
3.Test the analysis of "开关/插座 -代金券-西门子"
curl -XGET "http://localhost:9200/newmall/_analyze?analyzer=smartcn" -d'
{
"text":"开关/插座 -代金券-西门子"
}'
yields the correct tokens
{
"tokens": [
{
"token": "开关",
"start_offset": 0,
"end_offset": 2,
"type": "word",
"position": 0
},
{
"token": "插座",
"start_offset": 3,
"end_offset": 5,
"type": "word",
"position": 2
},
{
"token": "代金",
"start_offset": 7,
"end_offset": 9,
"type": "word",
"position": 4
},
{
"token": "券",
"start_offset": 9,
"end_offset": 10,
"type": "word",
"position": 5
},
{
"token": "西门子",
"start_offset": 11,
"end_offset": 14,
"type": "word",
"position": 7
}
]
}
4.Index a document with text we just analyzed
curl -XPOST "http://localhost:9200/newmall/mall/1" -d'
{
"text": "开关/插座 -代金券-西门子"
}'
5.Perform match
query on "开关"
curl -XGET "http://localhost:9200/newmall/mall/_search?explain" -d'
{
"query": {
"match": {
"text": "开关"
}
}
}'
yields no results
6.But performing match
query on "开关/"
curl -XGET "http://localhost:9200/newmall/mall/_search?explain" -d'
{
"query": {
"match": {
"text": "开关/"
}
}
}'
yields results (with explanation)
{
"took": 2,
"timed_out": false,
"_shards": {
"total": 5,
"successful": 5,
"failed": 0
},
"hits": {
"total": 1,
"max_score": 0.13424811,
"hits": [
{
"_shard": 3,
"_node": "F4_VMt-7Qpi11ACD3y4QYw",
"_index": "newmall",
"_type": "mall",
"_id": "1",
"_score": 0.13424811,
"_source": {
"text": "开关/插座 -代金券-西门子"
},
"_explanation": {
"value": 0.13424811,
"description": "sum of:",
"details": [
{
"value": 0.13424811,
"description": "weight(text:开关 in 0) [PerFieldSimilarity], result of:",
"details": [
{
"value": 0.13424811,
"description": "fieldWeight in 0, product of:",
"details": [
{
"value": 1,
"description": "tf(freq=1.0), with freq of:",
"details": [
{
"value": 1,
"description": "termFreq=1.0",
"details": []
}
]
},
{
"value": 0.30685282,
"description": "idf(docFreq=1, maxDocs=1)",
"details": []
},
{
"value": 0.4375,
"description": "fieldNorm(doc=0)",
"details": []
}
]
}
]
},
{
"value": 0,
"description": "match on required clause, product of:",
"details": [
{
"value": 0,
"description": "# clause",
"details": []
},
{
"value": 3.2588913,
"description": "_type:mall, product of:",
"details": [
{
"value": 1,
"description": "boost",
"details": []
},
{
"value": 3.2588913,
"description": "queryNorm",
"details": []
}
]
}
]
}
]
}
}
]
}
}