# Unexpected "Nesting" for Single Property on IndexRequests Failing

**URL:** https://discuss.elastic.co/t/unexpected-nesting-for-single-property-on-indexrequests-failing/282930
**Category:** Elasticsearch
**Created:** [August 31, 2021, 1:44pm UTC](https://discuss.elastic.co/t/unexpected-nesting-for-single-property-on-indexrequests-failing/282930 "2021-08-31T13:44:29Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![rionmonster](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rionmonster/32/93954_2.png) [@rionmonster](https://discuss.elastic.co/u/rionmonster)
#### Post date: [August 31, 2021, 1:44pm UTC](https://discuss.elastic.co/t/unexpected-nesting-for-single-property-on-indexrequests-failing/282930/1 "2021-08-31T13:44:29Z")

</div>

Hi all, I recently started using Elasticsearch and I was a bit baffled when I tried to create an IndexRequest to one of my indices using the following payload and receiving a limit of mapping depth exceeded message:

```auto
"stringAttributes": {
    "64": "0",
    "66": "test_device",
    "3": "https://app.test.com/files/123",
    "67": "https://test.com/static/ng/appSecurlets/index.html",
    "68": "https://test.com/static/ng/appThreats/index.html#/?deeplink=users&user_email=test@test.com",
    "72": "test.com",
    "8": "DAR",
    "73": "test@test.com",
    "9": "securlet.test",
    "11": "https://app.test.com/files/123",
    "14": "test@test.com",
    "15": "/All Files/",
    "26": "796fe895-fd17-4276-a5da-02c033ee0d00",
    "42": "787890963328_5790318",
    "43": "file",
    "45": "test@test.com",
    "46": "test@test.com",
    "47": "Test Testerson",
    "48": "unknown",
    "49": "https://test/static/ng/appSecurlets/index.html#/test?identification=787890963328&instance=5790318&exposure=unexposed",
    "50": "https://test/static/ng/appForensics/index.html#/?user=test@test.com&app=Box&range_from=1628535622&range_to=1629140422",
    "51": "https://test/static/ng/appSecurlets/index.html#/test?deeplink=exposed_users&user_email=test@test.com",
    "53": "https://test/static/ng/appControls/index.html",
    "55": "Test",
    "59": "300df250-aef9-4311-89e0-5e1c02e7b314"
  }

```

which is being sent to Elastic via a simple IndexRequest:

```auto
return Requests.indexRequest()
                .index(index)
                .type("_doc")
                .source(jsonObject, XContentType.JSON)

```

As far as I can tell, there is little to no nesting going on, so I’m not quite sure why the request would be rejected. Any ideas? Maybe I’m just missing something or misunderstanding Elastic’s use of nesting? While I can see that there are over 20 properties beneath the attributes (which would exceed the default depth of 20), they are all siblings, so I’d expect the depth here to not necessarily increase for all of these elements below the top level one.

Any ideas?

---

<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: [September 1, 2021, 8:49am UTC](https://discuss.elastic.co/t/unexpected-nesting-for-single-property-on-indexrequests-failing/282930/2 "2021-09-01T08:49:48Z")

</div>

By having arbitrary string attributes as field names, you are creating a new field mapping for every number as a key. The more different numbers you have the bigger your mapping will be. I suppose that the names of the attributes can be anything?

You can also check this be retrieving the mapping back of your affected index.

---

<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 29, 2021, 8:50am UTC](https://discuss.elastic.co/t/unexpected-nesting-for-single-property-on-indexrequests-failing/282930/3 "2021-09-29T08:50:40Z")

</div>

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