# Ik 做不到分詞searching

**URL:** <https://discuss.elastic.co/t/ik-searching/260973>\
**Category:** 中文提问与讨论\
**Created:** [January 13, 2021, 10:40am UTC](https://discuss.elastic.co/t/ik-searching/260973 "2021-01-13T10:40:29Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tails](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tails/32/81921_2.png) [@Tails](https://discuss.elastic.co/u/Tails)\
**Post date:** [January 13, 2021, 10:40am UTC](https://discuss.elastic.co/t/ik-searching/260973/1 "2021-01-13T10:40:29Z")

</div>

入了 "張學友" 去dictionary

張學友 searching 正常

[root@localhost scripts]# curl -H 'Content-Type: application/json' -XPOST '[http://192.168.90.13:9200/p\_photo/\_search?pretty](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](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:

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

```

---

<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:** [February 10, 2021, 10:40am UTC](https://discuss.elastic.co/t/ik-searching/260973/2 "2021-02-10T10:40:38Z")

</div>

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