如何在 Kibana (ElasticSearch) 中编写 OR 查询?

How do I write an OR query in Kibana (ElasticSearch)?

使用 ElasicSearch 的 JSON 通过 Kibana 查询 DSL,我如何检索具有以下内容的所有文档:

你必须为此使用 Bool query :

... If the bool query is a filter context or has neither must or filter then at least one of the should queries must match a document for it to match the bool query

    POST <your_index>/_search 
    {
      "query": {
        "bool": {
          "should": [

              { "match_phrase" : { "messageTemplate" : "My message" } },
              { "term" : { "level" : "Error" } }

          ]
        }
      }
    }

或者,您可以在 Kibana 搜索栏中输入:

messageTemplate:"My message" || level:"Error"

messageTemplate:"My message" OR level:"Error"