gpt4 book ai didi

kibana - 在 Kibana 中查询完全匹配

转载 作者:行者123 更新时间:2023-12-01 15:38:52 37 4
gpt4 key购买 nike

在我的 Kibana 中,当我搜索我的文档时,我需要寻找完全匹配:
在我的文档中,我有一个名为 message 的字段。

所以如果我搜索(使用 Kibana)类似的东西:

message: "Provider replied with error code 2006"



我得到了所有包含这些词的一个实例的文档。
我想要完全匹配。

我正在运行 Kibana:5.3.2。而 Elasticsearch 是 5.3.2

最佳答案

在 Elasticsearch 中有两种类型的“字符串”。

  • 关键字:

    They are typically used for filtering (Find me all blog posts where status is published), for sorting, and for aggregations. Keyword
    fields are only searchable by their exact value.



    See the docs
  • 文本

    field to index full-text values, such as the body of an email or the description of a product. These fields are analyzed, that is they are passed through an analyzer to convert the string into a list of individual terms before being indexed.



    See the docs

  • 有时可以通过在字段中添加“.keyword”来访问关键字。所以试试这个:
    message.keyword: "Provider replied with error code 2006"

    否则,您必须检查您的映射并将其更改为关键字。

    关于kibana - 在 Kibana 中查询完全匹配,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46975434/

    37 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com