# Index Mapping - Sub-field mapped instead of root field

**URL:** https://discuss.elastic.co/t/index-mapping-sub-field-mapped-instead-of-root-field/142745
**Category:** Elasticsearch
**Created:** [August 2, 2018, 10:46am UTC](https://discuss.elastic.co/t/index-mapping-sub-field-mapped-instead-of-root-field/142745 "2018-08-02T10:46:11Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![inversion](https://avatars.discourse-cdn.com/v4/letter/i/3e96dc/32.png) [@inversion](https://discuss.elastic.co/u/inversion)
#### Post date: [August 2, 2018, 10:46am UTC](https://discuss.elastic.co/t/index-mapping-sub-field-mapped-instead-of-root-field/142745/1 "2018-08-02T10:46:11Z")

</div>

My index mapping specifies

```
            "subjects": {
                "type": "keyword"
            },

```

Normally, when I add a document with the subjects field, it works perfectly. However, if I add a document like this. The root-level subjects field is not indexed. Does this sound like intended behaviour or a possible bug?

```
{
	"subjects": "x"
	"request": {
		"subjects": "y"
	}
}

```

I am using Elasticsearch 6.2.3. Thanks.

---

<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: [August 30, 2018, 10:46am UTC](https://discuss.elastic.co/t/index-mapping-sub-field-mapped-instead-of-root-field/142745/2 "2018-08-30T10:46:16Z")

</div>

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