Ik 做不到分詞searching

入了 "張學友" 去dictionary

張學友 searching 正常

[root@localhost scripts]# curl -H 'Content-Type: application/json' -XPOST 'http://192.168.90.13:9200/p_photo/_search?pretty' -d'

{
"query" : { "term" : { "caption" : "張學友" }}
}'
{
"took" : 1,
"timed_out" : false,
"_shards" : {
"total" : 1,
"successful" : 1,
"skipped" : 0,
"failed" : 0
},
"hits" : {
"total" : {
"value" : 1,
"relation" : "eq"
},
"max_score" : 0.2876821,
"hits" : [
{
"_index" : "p_photo",
"_type" : "_doc",
" id" : "3mxa-nYBFbrkHdy06eU ",
"_score" : 0.2876821,
"_source" : {
"caption" : "張學友"
}
}
]
}
}

但 "學友" searching 找不到
[root@localhost scripts]# curl -H 'Content-Type: application/json' -XPOST 'http://192.168.90.13:9200/p_photo/_search?pretty' -d'

{
"query" : { "term" : { "caption" : "學友" }}
}'
{
"took" : 0,
"timed_out" : false,
"_shards" : {
"total" : 1,
"successful" : 1,
"skipped" : 0,
"failed" : 0
},
"hits" : {
"total" : {
"value" : 0,
"relation" : "eq"
},
"max_score" : null,
"hits" :
}
}

caption settings:

       "caption": {
            "type": "text",
            "analyzer": "ik_max_word",
            "search_analyzer": "ik_max_word"
        },

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