es nested嵌套查询

{
  "_source": [
    "DATE",
    "NEWS_ID",
    "COMPSCORELIST"
  ],
  "query": {
    "bool": {
      "must": [
        {
          "range": {
            "DATE": {
              "from": "2021-09-25T00:00:00+08:00",
              "include_lower": true,
              "include_upper": true,
              "to": "2021-09-25T23:59:59+08:00"
            }
          }
        },
        {
          "nested": {
            "path": "COMPSCORELIST",
            "query": {
              "bool": {
                "must": {
                  "exists": {
                    "field": "COMPSCORELIST"
                  }
                }
              }
            }
          }
        }
      ]
    }
  },
  "sort": {
    "DATE": "desc"
  },
  "size": 100
}

 

posted @ 2021-11-16 10:05  小酥肉是我  阅读(1067)  评论(0编辑  收藏  举报