Using properties of a field in another or recursive mapping


(Vishnu P S) #1

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

{
  "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.


(Christian Dahlqvist) #2

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