# Need help with Elasticsearch query on Kibana

**URL:** https://discuss.elastic.co/t/need-help-with-elasticsearch-query-on-kibana/250764
**Category:** Elasticsearch
**Created:** [October 2, 2020, 8:56am UTC](https://discuss.elastic.co/t/need-help-with-elasticsearch-query-on-kibana/250764 "2020-10-02T08:56:50Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Bahar\_Yilmaz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bahar_yilmaz/32/46274_2.png) [@Bahar\_Yilmaz](https://discuss.elastic.co/u/Bahar_Yilmaz)
#### Post date: [October 2, 2020, 8:56am UTC](https://discuss.elastic.co/t/need-help-with-elasticsearch-query-on-kibana/250764/1 "2020-10-02T08:56:50Z")

</div>

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

---

<div class="post-metadata">

### Author: ![Mark\_Harwood](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mark_harwood/32/10538_2.png) [@Mark\_Harwood](https://discuss.elastic.co/u/Mark_Harwood)
#### Post date: [October 5, 2020, 9:36am UTC](https://discuss.elastic.co/t/need-help-with-elasticsearch-query-on-kibana/250764/2 "2020-10-05T09:36:26Z")

</div>

The [inner hits](https://www.elastic.co/guide/en/elasticsearch/reference/7.9/inner-hits.html) query parameter can be used to control how much or how little of nested docs are returned.

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [November 2, 2020, 9:36am UTC](https://discuss.elastic.co/t/need-help-with-elasticsearch-query-on-kibana/250764/3 "2020-11-02T09:36:27Z")

</div>

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