# Issue on creating index mapping

**URL:** https://discuss.elastic.co/t/issue-on-creating-index-mapping/246475
**Category:** Elasticsearch
**Created:** [August 26, 2020, 2:49pm UTC](https://discuss.elastic.co/t/issue-on-creating-index-mapping/246475 "2020-08-26T14:49:54Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![jakobdoering](https://avatars.discourse-cdn.com/v4/letter/j/ac8455/32.png) [@jakobdoering](https://discuss.elastic.co/u/jakobdoering)
#### Post date: [August 26, 2020, 2:49pm UTC](https://discuss.elastic.co/t/issue-on-creating-index-mapping/246475/1 "2020-08-26T14:49:54Z")

</div>

Hi, i would like to create the following structure with my index template:

```auto
    egress.bytes
    egress.test
    egress.test.delta
    egress.test.performance
    egress.test.state
    egress.test.state.performance.low
    egress.test.state.performance.high

```

i tried using the following api request to create the mapping:

```auto
    PUT testing_index_template_mapping/_mapping
    {
      "properties": {
        "egress": {
          "properties": {
            "bytes": {
              "type": "integer"
            },
            "test": {
              "properties": {
                "delta": {
                  "type": "integer"
                },
                "state": {
                  "properties": {
                    "performance": {
                      "properties": {
                        "high": {
                          "type": "integer"
                        },
                        "low": {
                          "type": "integer"
                        }
                      },
                      "type": "integer"
                    }
                  },
                  "type": "integer"
                }
              },
              "type": "integer"
            }
          }
        }
      }
    }

```

but elasticsearch keeps returning the following error:

```auto
    {
      "error" : {
        "root_cause" : [
          {
            "type" : "mapper_parsing_exception",
            "reason" : "Mapping definition for [test] has unsupported parameters: [properties : {delta={type=integer}, state={type=integer, properties={performance={type=integer, properties={high={type=integer}, low={type=integer}}}}}}]"
          }
        ],
        "type" : "mapper_parsing_exception",
        "reason" : "Mapping definition for [test] has unsupported parameters: [properties : {delta={type=integer}, state={type=integer, properties={performance={type=integer, properties={high={type=integer}, low={type=integer}}}}}}]"
      },
      "status" : 400
    }

```

I just cant get it to work. Do you hae any tips for me to fix the issue?

---

<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: [August 26, 2020, 3:20pm UTC](https://discuss.elastic.co/t/issue-on-creating-index-mapping/246475/2 "2020-08-26T15:20:59Z")

</div>

The egress.test field have properties under it so will be an object. It can therefore not also be of type integer. You can not have field names with dots.

---

<div class="post-metadata">

### Author: ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)
#### Post date: [August 26, 2020, 4:09pm UTC](https://discuss.elastic.co/t/issue-on-creating-index-mapping/246475/3 "2020-08-26T16:09:21Z")

</div>

So In short this should be correct, your objects as @Christian_Dahlqvist said can not have types. If you want a type that represents that object state / statues you need to add another field in the object and call it state or value or some additional field

```auto
    egress.bytes
    egress.test <<- Object
    egress.test.delta
    egress.test.state <<- Object
    egress.test.state.performance <<- Object
    egress.test.state.performance.low
    egress.test.state.performance.high

```

```
PUT testing_index_template_mapping/_mapping
{
  "properties": {
    "egress": {
      "properties": {
        "bytes": {
          "type": "integer"
        },
        "test": {
          "properties": {
            "delta": {
              "type": "integer"
            },
            "state": {
              "properties": {
                "performance": {
                  "properties": {
                    "high": {
                      "type": "integer"
                    },
                    "low": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
```

---

<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: [September 23, 2020, 4:09pm UTC](https://discuss.elastic.co/t/issue-on-creating-index-mapping/246475/4 "2020-09-23T16:09:22Z")

</div>

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