# How to return data from the document tree

**URL:** <https://discuss.elastic.co/t/how-to-return-data-from-the-document-tree/186480>\
**Category:** Elasticsearch\
**Created:** [June 19, 2019, 1:53pm UTC](https://discuss.elastic.co/t/how-to-return-data-from-the-document-tree/186480 "2019-06-19T13:53:39Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![tomcomp](https://avatars.discourse-cdn.com/v4/letter/t/dfb087/32.png) [@tomcomp](https://discuss.elastic.co/u/tomcomp)\
**Post date:** [June 19, 2019, 1:53pm UTC](https://discuss.elastic.co/t/how-to-return-data-from-the-document-tree/186480/1 "2019-06-19T13:53:39Z")

</div>

Hello, I would like to ask you how to return data from the document tree. University =\> Faculty =\> Departments =\> Subjects =\> Annotation + syllabus. The document is stored in the ES "index": "university" =\> "fields": "Faculty" =\> "fields": "Departments" =\> "fields": "Subjects" =\> and syllabus and annotation. I search the annotation and syllabus, but I need to return the subject name (in híts). Can anyone help me. Thank you. Tom

```
 GET _search
{
   "_source": ["fakulta.katedra.predmet.sylabusAAnotaceProp.sylabusEN"],
    "query": {
        "bool": {
        "must": [{
              "query_string": {
                                "fields": ["fakulta.katedra.predmet.sylabusAAnotaceProp.anotaceEN", 
                                                "fakulta.katedra.predmet.sylabusAAnotaceProp.anotaceEN", 
                                                "fakulta.katedra.predmet.nazev"],
                                "query": "programming AND pascal"}
                                 }
                      ]
                }
          },
          "aggs":{},
          "highlight": {
                  "pre_tags": [
                          "<em>"
                           ],
                  "post_tags": [
                          "</em>"
                  ],
           "fields": {
                  "body": {
                           "number_of_fragments": 1,
                           "fragment_size": 20
                     },
                     "fakulta.katedra.predmet.sylabusAAnotaceProp.sylabusEN": {},
                      "fakulta.katedra.predmet.sylabusAAnotaceProp.anotaceEN": {},
                      "fakulta.katedra.predmet.nazev": {}
                      }
              }

```

}

---

<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:** [July 17, 2019, 1:53pm UTC](https://discuss.elastic.co/t/how-to-return-data-from-the-document-tree/186480/2 "2019-07-17T13:53:57Z")

</div>

Closed on July 17, 2019, 1:53pm UTC

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