Elasticsearch: Return only nested inner_hits

后端 未结 1 1535
清歌不尽
清歌不尽 2021-02-07 14:15

I have the following query:

GET /networkcollection/branch_routers/_search/
{
  \"query\": {
    \"nested\": {
      \"path\": \"queries\",
      \"query\": {
            


        
1条回答
  •  清歌不尽
    2021-02-07 14:43

    Should be able to achieve it by disabling source-field at top-level by specifying "_source" : false

    POST /networkcollection/branch_routers/_search/
    {
      "_source" : false,
      "query": {
        "nested": {
          "path": "queries",
          "query": {
            "bool": {
              "must": [
                { "match": 
                  { "queries.dateQuery": "20160101T200000.000Z" }
                }
              ]
            }
          },
          "inner_hits" : {}
        }
      }
    }
    

    0 讨论(0)
提交回复
热议问题