# Are there reserved fields in a document?

**URL:** <https://discuss.elastic.co/t/are-there-reserved-fields-in-a-document/66935>\
**Category:** Elasticsearch\
**Created:** [November 23, 2016, 3:31am UTC](https://discuss.elastic.co/t/are-there-reserved-fields-in-a-document/66935 "2016-11-23T03:31:33Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![essn](https://avatars.discourse-cdn.com/v4/letter/e/c89c15/32.png) [@essn](https://discuss.elastic.co/u/essn)\
**Post date:** [November 23, 2016, 3:31am UTC](https://discuss.elastic.co/t/are-there-reserved-fields-in-a-document/66935/1 "2016-11-23T03:31:34Z")

</div>

I used the field naming to 'ownerid'. Strictly 'ownerid', not 'ownerId', 'ownerId', 'OwnerID' things..  
These are processed well. But only 'ownerid' is not working when I map first time. I never had defined 'ownerid'. NEVER!  
Here is example.

```auto
http://127.0.0.1:9200/example_index/_mapping/example_type
{
  "properties": {
    "ownerid": {
      "type": "long"
    }
  }
}

```

```json
{
  "error": {
    "root_cause": [
      {
        "type": "illegal_argument_exception",
        "reason": "mapper [ownerid] cannot be changed from type [int] to [long]"
      }
    ],
    "type": "illegal_argument_exception",
    "reason": "mapper [ownerid] cannot be changed from type [int] to [long]"
  },
  "status": 400
}

```

So I guessed It's reserved thing. but I can't know where exist. And no guides, issues...

Anybody has same issue? or please reproduce this issue and check out.

oh. elasticsearch version is 2.4.1. this is important. 🙂

Thanks!

---

<div class="post-metadata">

**Author:** ![forloop](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/forloop/32/9021_2.png) [@forloop](https://discuss.elastic.co/u/forloop)\
**Post date:** [November 23, 2016, 3:57am UTC](https://discuss.elastic.co/t/are-there-reserved-fields-in-a-document/66935/2 "2016-11-23T03:57:09Z")

</div>

what's in the mappings for the index? You can run

```auto
curl -XGET "http://localhost:9200/example_index/_mapping/example_type"

```

The error indicates that you already have a field called `ownerid` that is mapped as `int`. You may not have explicitly mapped this; if you have [dynamic mapping enabled](https://www.elastic.co/guide/en/elasticsearch/guide/current/dynamic-mapping.html) then Elasticsearch would have dynamically mapped this field from an indexed document, inferring the type from the field value.

---

<div class="post-metadata">

**Author:** ![essn](https://avatars.discourse-cdn.com/v4/letter/e/c89c15/32.png) [@essn](https://discuss.elastic.co/u/essn)\
**Post date:** [November 23, 2016, 4:40am UTC](https://discuss.elastic.co/t/are-there-reserved-fields-in-a-document/66935/3 "2016-11-23T04:40:59Z")

</div>

> curl -XGET "[http://localhost:9200/example\_index/\_mapping/example\_type](http://localhost:9200/example_index/_mapping/example_type)"

result is NOTHING. just `200 OK {}`. I notified the opinion which that was the first mapping.

So I issued at elasticsearch github. But it's closed immediately with same reason you thought. 🙂

Did you try to reproducing that issue? Thanks for reply.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [November 23, 2016, 8:04am UTC](https://discuss.elastic.co/t/are-there-reserved-fields-in-a-document/66935/4 "2016-11-23T08:04:16Z")

</div>

I just ran that test which works well with 2.4.1:

```auto
DELETE test
PUT test
PUT test/_mapping/type
{
  "properties": {
    "ownerid": {
      "type": "long"
    }
  }
}

```

It gives:

```auto
{
  "acknowledged": true
}

```

---

<div class="post-metadata">

**Author:** ![essn](https://avatars.discourse-cdn.com/v4/letter/e/c89c15/32.png) [@essn](https://discuss.elastic.co/u/essn)\
**Post date:** [November 23, 2016, 12:46pm UTC](https://discuss.elastic.co/t/are-there-reserved-fields-in-a-document/66935/5 "2016-11-23T12:46:38Z")

</div>

@dadoonet I checked that your test from first app install repeatedly. First, I'm so sorry. The cause of my issue was fail of restoring snapshot. I once did fail restoring of snapshot. So I guess that issue occured since garbage thing. I reinstalled app and mapped, It worked well. Thanks for your patient about such a idiot question. I'm really sorry.

---

<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 21, 2016, 12:46pm UTC](https://discuss.elastic.co/t/are-there-reserved-fields-in-a-document/66935/6 "2016-12-21T12:46:46Z")

</div>

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