# \_source\_includes on a tree

**URL:** <https://discuss.elastic.co/t/source-includes-on-a-tree/206438>\
**Category:** Elasticsearch\
**Created:** [November 4, 2019, 4:34pm UTC](https://discuss.elastic.co/t/source-includes-on-a-tree/206438 "2019-11-04T16:34:16Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![SRALK](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sralk/32/57116_2.png) [@SRALK](https://discuss.elastic.co/u/SRALK)\
**Post date:** [November 4, 2019, 4:34pm UTC](https://discuss.elastic.co/t/source-includes-on-a-tree/206438/1 "2019-11-04T16:34:17Z")

</div>

Hello,  
I have a document which contains a tree (of unknown depth) with a lot of information and i want to get only a subset of the data of each node (ex: only the key hello in the following example).

```auto
{
    "id": 42,
    "tree": [
        {
            "hello": "world",
            "children": [
                {
                    "hello": "europe",
                    "children": [
                        {
                            "hello": "france",
                            "children": []
                        }
                    ]
                }
            ]
        }
    ]
}

```

I have tried with `_source_includes=tree.*hello` / `tree.*.hello` (and a lot of other combination) but i get only the first level. Is there a way to perform an inclusion like this ?

Thanks for your support 🙂

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [November 5, 2019, 10:00am UTC](https://discuss.elastic.co/t/source-includes-on-a-tree/206438/2 "2019-11-05T10:00:38Z")

</div>

try

```auto
GET test/_search
{
  "_source": "**.hello"
}

```

---

<div class="post-metadata">

**Author:** ![SRALK](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sralk/32/57116_2.png) [@SRALK](https://discuss.elastic.co/u/SRALK)\
**Post date:** [November 5, 2019, 10:33am UTC](https://discuss.elastic.co/t/source-includes-on-a-tree/206438/3 "2019-11-05T10:33:11Z")

</div>

I tested it unfortunately it didn't work, it returned some other keys not at all related to `"hello"` from the root document.

Also with `tree. **.hello` and `tree.** hello` etc, it didn't work.

Is there a place where i can find the documentation of those wildcard usage ? (the \_source documentation only has simple use-cases)

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [November 5, 2019, 8:23pm UTC](https://discuss.elastic.co/t/source-includes-on-a-tree/206438/4 "2019-11-05T20:23:57Z")

</div>

I tested on 7.4.1 - can you try with the latest release as well?

---

<div class="post-metadata">

**Author:** ![SRALK](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sralk/32/57116_2.png) [@SRALK](https://discuss.elastic.co/u/SRALK)\
**Post date:** [November 6, 2019, 7:24am UTC](https://discuss.elastic.co/t/source-includes-on-a-tree/206438/5 "2019-11-06T07:24:51Z")

</div>

Hum indeed i tested on an older version. I'll keep you updated once we have a 7.4.1 cluster.  
I'm flagging this one as the solution and will re-open in case we still fail to get it.  
Thank for your support.

---

<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:** [December 4, 2019, 7:25am UTC](https://discuss.elastic.co/t/source-includes-on-a-tree/206438/6 "2019-12-04T07:25:03Z")

</div>

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