# Elastic search how to ignore a field in mapping

**URL:** https://discuss.elastic.co/t/elastic-search-how-to-ignore-a-field-in-mapping/29145
**Category:** Elasticsearch
**Created:** [September 11, 2015, 3:21pm UTC](https://discuss.elastic.co/t/elastic-search-how-to-ignore-a-field-in-mapping/29145 "2015-09-11T15:21:20Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![apt275](https://avatars.discourse-cdn.com/v4/letter/a/9e8a1a/32.png) [@apt275](https://discuss.elastic.co/u/apt275)
#### Post date: [September 11, 2015, 3:21pm UTC](https://discuss.elastic.co/t/elastic-search-how-to-ignore-a-field-in-mapping/29145/1 "2015-09-11T15:21:20Z")

</div>

i am trying to create a mapping in elastic search to ignore one of the fields in my incoming data. i am following the documentation here

[https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-object-type.html#\_enabled\_3](https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-object-type.html#_enabled_3)

looks like the enabled property is exactly what i need , but i do not get the desired results.

Here is my mapping

```
PUT /comtest
{

  "mappings": {
     "ftype": {

        "properties": {
           "a": {
              "type": "string"
           },
           "b": {
              "type": "long"
           },

           "c":
           {
            "type" : "object",
                    "enabled" : false
           },
           "d": {
              "type": "string"
           },
           "e": {
              "type": "string"
           },
           "f": {
              "type": "boolean"
           },
           "g": {
              "type": "string"
           },
           "h": {
              "type": "string"
           },
           "i": {
              "type": "long"
           },
           "j": {
              "type": "string"
           },
           "k": {
              "type": "long"
           },
           "l": {
              "type": "date"
           },
           "m": {
              "type": "string"
           },
           "n": {
              "type": "string"
           },
           "o": {
              "type": "string"
           },
           "p": {
              "type": "string"
           }
        }
     }
  }

}

```

Here is my data

```
put /comtest/t/1
{
   "a": "cdcwc",
   "b": 1,
   "c": {
   "6": 22,
   "322": [
        444,
        "ew",
        "fwefwe."
    ]
},
"d": null,
"e": "svgerbgerb",
"f": false,
"g": "rethrt",
"h": null,
"i": 55,
"j": null,
"k": null,
"l": null,
"m": "dasd",
"n": 88,
"o": "1",
"p": "asas"
}

```

And I get the following error

{  
"error": "MapperParsingException[failed to parse [FIXMessage.448]]; nested: NumberFormatException[For input string: "ew"]; ",  
"status": 400  
}

Why wasn’t the field ignored ?

i have also tried using

"store":false,  
"include\_in\_all":false,  
"index":"no"

but to no effect.

---

<div class="post-metadata">

### Author: ![shanec](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/shanec/32/4004_2.png) [@shanec](https://discuss.elastic.co/u/shanec)
#### Post date: [September 11, 2015, 4:56pm UTC](https://discuss.elastic.co/t/elastic-search-how-to-ignore-a-field-in-mapping/29145/2 "2015-09-11T16:56:11Z")

</div>

Ah. I take it from this example that you're trying to completely discard the "c" field, via `"enabled":false`

If that's your intent, you've only got 1 small error: you've created the mapping of `ftype` under the `comtest` index, but when you add data, you're using `/comtest/t/1` which means it's trying to use the mapping `t`, which doesn't exist.

---

<div class="post-metadata">

### Author: ![shanec](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/shanec/32/4004_2.png) [@shanec](https://discuss.elastic.co/u/shanec)
#### Post date: [September 11, 2015, 5:03pm UTC](https://discuss.elastic.co/t/elastic-search-how-to-ignore-a-field-in-mapping/29145/3 "2015-09-11T17:03:40Z")

</div>

It's also worth noting that the fundamental reason you need this is hat c-\>322 field is an array of mixed values, which isn't allowed ([https://www.elastic.co/guide/en/elasticsearch/guide/current/complex-core-fields.html#\_multivalue\_fields](https://www.elastic.co/guide/en/elasticsearch/guide/current/complex-core-fields.html#_multivalue_fields)). You could switch that to be a nested JSON object instead of a mixed array and that would be fine as well.

---

<div class="post-metadata">

### Author: ![apt275](https://avatars.discourse-cdn.com/v4/letter/a/9e8a1a/32.png) [@apt275](https://discuss.elastic.co/u/apt275)
#### Post date: [September 14, 2015, 5:48pm UTC](https://discuss.elastic.co/t/elastic-search-how-to-ignore-a-field-in-mapping/29145/4 "2015-09-14T17:48:34Z")

</div>

correct ! rookie mistake. thanks for the advice.

---

<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:50pm UTC](https://discuss.elastic.co/t/elastic-search-how-to-ignore-a-field-in-mapping/29145/5 "2017-07-05T23:50:25Z")

</div>


