# Using properties of a field in another or recursive mapping

**URL:** <https://discuss.elastic.co/t/using-properties-of-a-field-in-another-or-recursive-mapping/158275>\
**Category:** Elasticsearch\
**Created:** [November 27, 2018, 6:05am UTC](https://discuss.elastic.co/t/using-properties-of-a-field-in-another-or-recursive-mapping/158275 "2018-11-27T06:05:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vishnu\_P\_S](https://avatars.discourse-cdn.com/v4/letter/v/5f9b8f/32.png) [@Vishnu\_P\_S](https://discuss.elastic.co/u/Vishnu_P_S)\
**Post date:** [November 27, 2018, 6:05am UTC](https://discuss.elastic.co/t/using-properties-of-a-field-in-another-or-recursive-mapping/158275/1 "2018-11-27T06:05:08Z")

</div>

Hi,  
I have a mapping which uses a recursive structure.  
Eg :

```auto
{
  "mappings": {
    "test": {
      "properties": {
" **example**": {
          "type": "nested",
          "properties": {
            "description": {
              "type": "text",
              "fields": {
                "keyword": {
                  "type": "keyword",
                  "ignore_above": 256
                }
              }
            },
            "name": {
              "type": "text",
              "fields": {
                "keyword": {
                  "type": "keyword",
                  "ignore_above": 256
                }
              }
            },
            " **next**":{
              "type":"example"
            }
          }
        }
}
}
}
}

```

Here the type **next** have a recursive structure and have the same properties of the field **example**. How to write the schema mapping for this kind of recursive fields.

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [November 27, 2018, 7:56am UTC](https://discuss.elastic.co/t/using-properties-of-a-field-in-another-or-recursive-mapping/158275/2 "2018-11-27T07:56:47Z")

</div>

Very deeply nested document structures can be quite inefficient. What is the problem you are trying to solve here? What is your use-case?

---

<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 25, 2018, 7:56am UTC](https://discuss.elastic.co/t/using-properties-of-a-field-in-another-or-recursive-mapping/158275/3 "2018-12-25T07:56:51Z")

</div>

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