Need help with Elasticsearch query on Kibana

Hi ,
I need help with the Elasticsearch query.
My query is like this below.

GET record/_search
{
  "_source": "Climate.Product.ProductCategory.ProductSubcategory.ProductModel.UnitMeasure.ProductModelIllustration.ProductDocument",
  "query": {
    "nested": {
      "path": "Climate.Product.ProductCategory.ProductSubcategory.ProductModel.UnitMeasure.ProductModelIllustration.ProductDocument",
      "query": {
        "bool": {
          "must": [
            {
              "match_phrase": {
                "Climate.Product.ProductCategory.ProductSubcategory.ProductModel.UnitMeasure.ProductModelIllustration.ProductDocument.DocumentNode": "/3/1/"
              }
            }
          ]
        }
      }
    }
  }
}

And this is its result.

{
  "took" : 3,
  "timed_out" : false,
  "_shards" : {
    "total" : 1,
    "successful" : 1,
    "skipped" : 0,
    "failed" : 0
  },
  "hits" : {
    "total" : {
      "value" : 1,
      "relation" : "eq"
    },
    "max_score" : 2.1220012,
    "hits" : [
      {
        "_index" : "record",
        "_type" : "_doc",
        "_id" : "23",
        "_score" : 2.1220012,
        "_source" : {
          "Climate" : [
            {
              "Product" : [
                {
                  "ProductCategory" : [
                    {
                      "ProductSubcategory" : [
                        {
                          "ProductModel" : [
                            {
                              "UnitMeasure" : [
                                {
                                  "ProductModelIllustration" : [
                                    {
                                      "ProductDocument" : [
                                        {
                                          "DocumentNode" : "/3/1/",
                                          "ProductID" : 506,
                                          "ModifiedDate" : "2013-12-29T13:51:58.103"
                                        },
                                        {
                                          "DocumentNode" : "/3/2/",
                                          "ProductID" : 506,
                                          "ModifiedDate" : "2013-12-29T13:51:58.103"
                                        }
                                      ]
                                    }
                                  ]
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ]
        }
      }
    ]
  }
}

I want to get just the document that contains DocumentNode:"/3/1/" , not whole ProductDocument.

Is there any way to do this ?

Thanks

The inner hits query parameter can be used to control how much or how little of nested docs are returned.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.