我尝试在elasticsearch语句中使用此查询:
(ip=xx.xx.xx.xx and status="running") or (ip=xx.xx.xx.xx and status="running")
有谁能告诉我如何用ElasticSearch查询来写这个吗?
pxiryf3j1#
阅读关于Bool Queries请尝试以下查询:
{ "query": { "bool": { "minimum_should_match": 1, "should": [ { "bool": { "must": [ { "term": { "ip": { "value": "xx.xx.xx.xx" } } }, { "term": { "status": { "value": "running" } } } ] } }, { "bool": { "must": [ { "term": { "ip": { "value": "bb.bb.bb.bb" } } }, { "term": { "status": { "value": "running" } } } ] } } ] } } }
1条答案
按热度按时间pxiryf3j1#
阅读关于Bool Queries
请尝试以下查询: