elasticsearch not_analyzed不起作用

时间:2015-09-26 09:57:35

标签: indexing elasticsearch mapping

为什么弹性搜索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
    }]
}

1 个答案:

答案 0 :(得分:0)

您的网址有误,即您有两个?个字符,pretty之前的字符应为&符号&,请尝试使用此字符

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