# Can not add mapping

**URL:** <https://discuss.elastic.co/t/can-not-add-mapping/252979>\
**Category:** Elasticsearch\
**Created:** [October 22, 2020, 9:56am UTC](https://discuss.elastic.co/t/can-not-add-mapping/252979 "2020-10-22T09:56:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alex\_Pravdin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/alex_pravdin/32/45475_2.png) [@Alex\_Pravdin](https://discuss.elastic.co/u/Alex_Pravdin)\
**Post date:** [October 22, 2020, 9:56am UTC](https://discuss.elastic.co/t/can-not-add-mapping/252979/1 "2020-10-22T09:56:30Z")

</div>

I'm using Elasticsearch 5.6 (I know it's outdated but I can not switch it right now).

I'm doing the following request:

```auto
    {
       "settings":{
          "index":{
             "analysis":{
                "filter":{
                   "autocomplete_filter":{
                      "type":"ngram",
                      "min_gram":2,
                      "max_gram":14
                   }
                },
                "char_filter":{
                   "parentheses_filter":{
                      "type":"mapping",
                      "mappings":{
                         "(":"_",
                         ")":"_"
                      }
                   }
                },
                "analyzer":{
                   "autocomplete":{
                      "type":"custom",
                      "tokenizer":"standard",
                      "filter":[
                         "lowercase",
                         "asciifolding",
                         "parentheses_filter",
                         "autocomplete_filter"
                      ]
                   }
                }
             }
          }
       },
       "mappings":{
          "default":{
             "properties":{
                    ...
             }
          }
       }
    }

```

And getting the following error:

```auto
    {
       "error":{
          "root_cause":[
             {
                "type":"illegal_argument_exception",
                "reason":"mapping requires either `mappings` or `mappings_path` to be configured"
             }
          ],
          "type":"illegal_argument_exception",
          "reason":"mapping requires either `mappings` or `mappings_path` to be configured"
       },
       "status":400
    }

```

If my eyes don't lie me I provided the `mappings` property of the custom `mapping` filter but ES can't recognize it and asks me to provide it. What I'm doing wrong?

---

<div class="post-metadata">

**Author:** ![Alex\_Pravdin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/alex_pravdin/32/45475_2.png) [@Alex\_Pravdin](https://discuss.elastic.co/u/Alex_Pravdin)\
**Post date:** [October 23, 2020, 2:46am UTC](https://discuss.elastic.co/t/can-not-add-mapping/252979/2 "2020-10-23T02:46:46Z")

</div>

Ah, my bad, mappings should be an array, not an object.

---

<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:** [November 20, 2020, 2:46am UTC](https://discuss.elastic.co/t/can-not-add-mapping/252979/3 "2020-11-20T02:46:57Z")

</div>

Closed on November 20, 2020, 2:46am UTC

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