# Field Collapsing

**URL:** https://discuss.elastic.co/t/field-collapsing/107119
**Category:** Elasticsearch
**Created:** [November 10, 2017, 12:06am UTC](https://discuss.elastic.co/t/field-collapsing/107119 "2017-11-10T00:06:33Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Atul\_Harsha](https://avatars.discourse-cdn.com/v4/letter/a/e8c25b/32.png) [@Atul\_Harsha](https://discuss.elastic.co/u/Atul_Harsha)
#### Post date: [November 10, 2017, 12:06am UTC](https://discuss.elastic.co/t/field-collapsing/107119/1 "2017-11-10T00:06:33Z")

</div>

Mapping:

```
PUT /my_index/_mapping/blogpost
{
  "properties": {
    "user": {
      "properties": {
        "name": { 
          "type": "string",
          "fields": {
            "raw": { 
              "type": "string",
              "index": "not_analyzed"
            }
          }
        }
      }
    }
  }
}

```

Error:

```
{
  "error": {
    "root_cause": [
      {
        "type": "illegal_argument_exception",
        "reason": "mapper [user] of different type, current_type [long], merged_type [ObjectMapper]"
      }
    ],
    "type": "illegal_argument_exception",
    "reason": "mapper [user] of different type, current_type [long], merged_type [ObjectMapper]"
  },
  "status": 400
}

```

Data to be ingested:

```
PUT /my_index/blogpost/2
{
  "title": "Relationships",
  "body": "It's complicated...",
  "user": {
    "id": 1,
    "name": "John Smith"
  }
}

```

How should I resolve this mapping Issue?

---

<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: [November 10, 2017, 9:24am UTC](https://discuss.elastic.co/t/field-collapsing/107119/2 "2017-11-10T09:24:53Z")

</div>

It seems you have indexed the `user` field as a long somewhere. you need to reindex your data to fix it. Take a look at the [reindex API](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/docs-reindex.html) how to index your data into another index, where you can fix the mapping beforehand.

---

<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 8, 2017, 9:25am UTC](https://discuss.elastic.co/t/field-collapsing/107119/3 "2017-12-08T09:25:26Z")

</div>

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