【问题标题】:elasticsearch not_analyzed doesn't workelasticsearch not_analyzed 不起作用
【发布时间】:2015-12-24 02:17:22
【问题描述】:

为什么我试图解决的弹性搜索 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
    }]
}

【问题讨论】:

  • 请写清楚
  • 您是否通过映射将这些字段之一设置为 not_analyzed?那么其中一个结果是出乎意料的吗?您能否提供映射中的相关 sn-p?
  • 对不起,我的英语很差。我已经得到了答案。我的一个节点有不同的中文分析器

标签: indexing elasticsearch mapping


【解决方案1】:

您的网址有误,即您有两个? 字符,pretty 之前的一个应该是和号&amp;,试试这个

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2016-05-08
    • 2015-01-31
    • 1970-01-01
    • 2015-04-29
    • 2013-06-27
    • 1970-01-01
    • 2018-03-11
    • 1970-01-01
    相关资源
    最近更新 更多