# Nested example from documentation

**URL:** <https://discuss.elastic.co/t/nested-example-from-documentation/150203>\
**Category:** Elasticsearch\
**Created:** [September 27, 2018, 1:32pm UTC](https://discuss.elastic.co/t/nested-example-from-documentation/150203 "2018-09-27T13:32:52Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vladimir](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vladimir/32/91042_2.png) [@Vladimir](https://discuss.elastic.co/u/Vladimir)\
**Post date:** [September 27, 2018, 1:32pm UTC](https://discuss.elastic.co/t/nested-example-from-documentation/150203/1 "2018-09-27T13:32:52Z")

</div>

Hello, I am starting with Elastic and now I am reading about nested sorting. [https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-sort.html#\_nested\_sorting\_examples](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-sort.html#_nested_sorting_examples) There is an example code which looks like:

```
POST /_search
{
   "query": {
      "nested": {
         "path": "parent",
         "query": {
            "bool": {
                "must": {"range": {"parent.age": {"gte": 21}}},
                "filter": {
                    "nested": {
                        "path": "parent.child",
                        "query": {"match": {"parent.child.name": "matt"}}
                    }
                }
            }
         }
      }
   },
   "sort" : [
      {
         "parent.child.age" : {
            "mode" : "min",
            "order" : "asc",
            "nested": {
               "path": "parent",
               "filter": {
                  "range": {"parent.age": {"gte": 21}}
               },
               "nested": {
                  "path": "parent.child",
                  "filter": {
                     "match": {"parent.child.name": "matt"}
                  }
               }
            }
         }
      }
   ]
}

```

There is no structure of document on which this query will work. I am new in it. I cant imagine the object structure from the query. Simple queries have PUT examples before. But this huge query object has not?  
Can somebody write me the PUT example for this query? (also to the documentation). Thanks.

---

<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:** [October 25, 2018, 1:42pm UTC](https://discuss.elastic.co/t/nested-example-from-documentation/150203/2 "2018-10-25T13:42:50Z")

</div>

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