0

下面是一个布尔搜索查询。我想删除此查询匹配的所有文档结果。怎么做?

我尝试通过查询接口删除(新的 api 在这里

CURL -XDELETE /index/doc/_query/routing=abc -d '{
  "query": {
    "bool": {
      "must": [
        {
          "term": {
            "_ua_family": "Firefox"
          }
        },
        {
          "range": {
            "created_at": {
              "gte": 1352147225,
              "lte": 1352752025
            }
          }
        }
      ],
      "should": [],
      "must_not": []
    }
  },
  "sort": {
    "created_at": "desc"
  },
  "facets": {
    "_message": {
      "histogram": {
        "field": "created_at",
        "interval": 3600
      }
    }
  },
  "from": 0,
  "size": 10
}'

弹性搜索响应包含

{
  "_shards": {
    "total": 1,
    "successful": 0,
    "failed": 1
  }
}
4

1 回答 1

2

得到它的工作,查询应该是

{
    "bool": {
        "must": [{
            "term": {
                "_ua_family": "Firefox"
            }
        }, {
            "range": {
                "created_at": {
                    "gte": 1352147225,
                    "lte": 1352752025
                }
            }
        }],
        "should": [],
        "must_not": []
    }
}
于 2012-11-12T23:09:13.780 回答