# Field mapping with "index":"no" causes error (ES2.0)

**URL:** https://discuss.elastic.co/t/field-mapping-with-index-no-causes-error-es2-0/33977
**Category:** Elasticsearch
**Created:** [November 6, 2015, 10:29am UTC](https://discuss.elastic.co/t/field-mapping-with-index-no-causes-error-es2-0/33977 "2015-11-06T10:29:38Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![aliaspooryorik](https://avatars.discourse-cdn.com/v4/letter/a/94ad74/32.png) [@aliaspooryorik](https://discuss.elastic.co/u/aliaspooryorik)
#### Post date: [November 6, 2015, 10:29am UTC](https://discuss.elastic.co/t/field-mapping-with-index-no-causes-error-es2-0/33977/1 "2015-11-06T10:29:38Z")

</div>

Hi,

This might be a n00bie error, but I have a mapping of:

```
"mappings": {
    "myindex": {
        "properties": {
            "json": {
                "type": "string",
                "index": "no"
            }
        }
    }
}

```

I want to store the 'json' field but do not need to search on it. Looking at the docs here: [Mapping | Elasticsearch: The Definitive Guide [2.x] | Elastic](https://www.elastic.co/guide/en/elasticsearch/guide/current/mapping-intro.html#_index_2)

Then as I understand it, I should be able to use "no" as a value for "index", however, this causes an error of:

> org.elasticsearch.index.mapper.MapperParsingException: wrong value for index [false] for field [json]

I definitely have "no" in the field not false as shown in the message. I've tried "not\_analyzed" and that works fine. I've also tried "false" but that gives the same error. I've also tried using a different field name in case 'json' is a reserved field but that didn't make a difference.

Thanks for any thoughts 🙂

---

<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 6, 2015, 11:07am UTC](https://discuss.elastic.co/t/field-mapping-with-index-no-causes-error-es2-0/33977/2 "2015-11-06T11:07:53Z")

</div>

It looks like a bug to me. Can you create a full recreation script?

---

<div class="post-metadata">

### Author: ![Florin\_Andrei](https://avatars.discourse-cdn.com/v4/letter/f/c77e96/32.png) [@Florin\_Andrei](https://discuss.elastic.co/u/Florin_Andrei)
#### Post date: [February 18, 2016, 1:33am UTC](https://discuss.elastic.co/t/field-mapping-with-index-no-causes-error-es2-0/33977/3 "2016-02-18T01:33:34Z")

</div>

Same issue here. Create a json file with index: no for some fields. Then:

```
# curl -XPUT http://localhost:9200/foobar_index/ -d @./foobar_index.config.json
{"error":{"root_cause":[{"type":"mapper_parsing_exception","reason":"Mapping definition for [roles] has unsupported parameters: [index : no]"}],"type":"mapper_parsing_exception","reason":"Failed to parse mapping [foobar_type]: Mapping definition for [roles] has unsupported parameters: [index : no]","caused_by":{"type":"mapper_parsing_exception","reason":"Mapping definition for [roles] has unsupported parameters: [index : no]"}},"status":400}

```

This is on elasticsearch-2.2.0

---

<div class="post-metadata">

### Author: ![Pradeep\_Gowda](https://avatars.discourse-cdn.com/v4/letter/p/ebca7d/32.png) [@Pradeep\_Gowda](https://discuss.elastic.co/u/Pradeep_Gowda)
#### Post date: [March 17, 2016, 6:47am UTC](https://discuss.elastic.co/t/field-mapping-with-index-no-causes-error-es2-0/33977/4 "2016-03-17T06:47:13Z")

</div>

Getting the same error. Do we have any fix for this?

---

<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: [July 5, 2017, 11:07pm UTC](https://discuss.elastic.co/t/field-mapping-with-index-no-causes-error-es2-0/33977/5 "2017-07-05T23:07:39Z")

</div>


