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
}

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM