Elastic Search 分析字段和 Kibana Graphs Legends

Elastic Search analyzing fields and Kibana Graphs Legends

我正在使用 elasticsearch 1.5.2 和 Kibana 4.0.3。

我在使用默认分析器时遇到问题,kibana 图表中的图例将字段拆分为 &、/ 和 -。 这是默认行为。 我已经尝试将字段设置为 not_analyzed,然后 kibana 图例显示正常,图表中的分组是我想要的,按字段。 问题是通配符不适用于搜索,要搜索您需要使用精确值的字段。

我一直没能找到能够保持字段原样的分析器或分词器。

关于如何使用 not_analyzed 但仍然像分析时一样进行搜索的任何想法?

谢谢, 艾萨克

你需要使用多字段(https://www.elastic.co/guide/en/elasticsearch/reference/current/_multi_fields.html)来实现你想要的。

例如:

"title": {
    "type": "string",
    "fields": {
        "raw":   { "type": "string", "index": "not_analyzed" }
    }
}

然后您将使用 title:whatever 进行搜索,并在 kibana 面板中使用 title.raw 以获得正确的图例行为。