# I can't edit mapping

**URL:** <https://discuss.elastic.co/t/i-cant-edit-mapping/157327>\
**Category:** Elasticsearch\
**Created:** [November 19, 2018, 10:12am UTC](https://discuss.elastic.co/t/i-cant-edit-mapping/157327 "2018-11-19T10:12:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![nu11ahnung](https://avatars.discourse-cdn.com/v4/letter/n/3be4f8/32.png) [@nu11ahnung](https://discuss.elastic.co/u/nu11ahnung)\
**Post date:** [November 19, 2018, 10:12am UTC](https://discuss.elastic.co/t/i-cant-edit-mapping/157327/1 "2018-11-19T10:12:34Z")

</div>

I want to create an index with an ngram analyzer. This is what I do  
PUT /my\_index/  
{  
"settings": {  
"analysis": {"filter": {  
"trigrams\_filter": {  
"type": "ngram",  
"min\_gram": 3,  
"max\_gram": 3,  
"token\_chars": [  
"letter",  
"digit"  
]  
}  
},  
"analyzer": {  
"trigrams": {  
"type": "custom",  
"tokenizer": "standard",  
"filter": [  
"lowercase",  
"trigrams\_filter"  
]  
}  
}  
}  
}  
}

Now I want to edit the mapping like this  
PUT /my\_index/\_mapping/\_all  
{

```
    "title": {
      "properties": {
        "title": {
          "type": "text",
          "fields": {
            
            "general": { 
              "type": "text",
              "analyzer": "trigrams"
            }
          }
        }
      }
    }
  }

```

what leads to this error message  
{  
"error": {  
"root\_cause": [  
{  
"type": "mapper\_parsing\_exception",  
"reason": "Root mapping definition has unsupported parameters: [title : {properties={title={type=text, fields={general={type=text, analyzer=trigrams}}}}}]"  
}  
],  
"type": "mapper\_parsing\_exception",  
"reason": "Root mapping definition has unsupported parameters: [title : {properties={title={type=text, fields={general={type=text, analyzer=trigrams}}}}}]"  
},  
"status": 400  
}

I have no idea what I am doing wrong please help me

---

<div class="post-metadata">

**Author:** ![abdon](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/abdon/32/9195_2.png) [@abdon](https://discuss.elastic.co/u/abdon)\
**Post date:** [November 20, 2018, 11:10am UTC](https://discuss.elastic.co/t/i-cant-edit-mapping/157327/2 "2018-11-20T11:10:50Z")

</div>

I don't think the `_all` in your update request URL should be there. Instead of `_all` you should provide the document type. And when you do so, there's no need to provide the document type as part of the body. If your document type is `title`, the second request should be:

```auto
PUT /my_index/_mapping/title
{
  "properties": {
    "title": {
      "type": "text",
      "fields": {
        "general": {
          "type": "text",
          "analyzer": "trigrams"
        }
      }
    }
  }
}

```

By the way, please format the code snippets that you post on this forum using the `</>` button, so those get formatted correctly.

---

<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 18, 2018, 11:10am UTC](https://discuss.elastic.co/t/i-cant-edit-mapping/157327/3 "2018-12-18T11:10:51Z")

</div>

Closed on December 18, 2018, 11:10am UTC

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