通过Kibana使用ElasicSearch的JSON查询DSL,如何检索所有具有以下内容的文档:
messageTemplate
等于My message
level
等于Error
最佳答案
您必须为此使用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" } }
]
}
}
}
关于elasticsearch - 如何在Kibana(ElasticSearch)中编写OR查询?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51103614/