2015-09-26 88 views
-2

为什么弹性搜索not_analyzed不工作我试图解决elasticsearch not_analyzed不起作用

映射在这里可见:http://i.stack.imgur.com/dGj7A.png

curl -XGET 'http://localhost:9200/gb/_analyze?field=tag?pretty' -d 'Black-cats' 
curl -XGET 'http://localhost:9200/gb/_analyze?field=tweet?pretty' -d 'Black-cats' 
the results are the same 
{ 
    "tokens": [{ 
     "token": "black", 
     "start_offset": 0, 
     "end_offset": 5, 
     "type": "<ALPHANUM>", 
     "position": 1 
    }, { 
     "token": "cats", 
     "start_offset": 6, 
     "end_offset": 10, 
     "type": "<ALPHANUM>", 
     "position": 2 
    }] 
} 
+0

请写清楚 – manetsus

+0

你有没有通过映射设置为not_analyze的字段之一?那么其中的一个结果是出乎意料的?你能否提供一个相关的映射片段? – eemp

+0

对不起,我的英语很差。我已经得到了答案。我的一个节点有不同的中文分析器 – Robin

回答

0

你有你的网址错了,即你有两个?字符,pretty前的一个应该是一个符号&,试试这个

curl -XGET 'http://localhost:9200/gb/_analyze?field=tag&pretty' -d 'Black-cats' 
                ^
                 | 
              this should be a &, not a ? 
相关问题