# Conflicts with existing mapping

**URL:** <https://discuss.elastic.co/t/conflicts-with-existing-mapping/119727>\
**Category:** Elasticsearch\
**Created:** [February 14, 2018, 5:43am UTC](https://discuss.elastic.co/t/conflicts-with-existing-mapping/119727 "2018-02-14T05:43:05Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![aneesh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aneesh/32/37819_2.png) [@aneesh](https://discuss.elastic.co/u/aneesh)\
**Post date:** [February 14, 2018, 5:43am UTC](https://discuss.elastic.co/t/conflicts-with-existing-mapping/119727/1 "2018-02-14T05:43:05Z")

</div>

Hi

while doing PutMappuing i am getting following error

"Mapper for [uUserId] conflicts with existing mapping in other types:\n[mapper [uUserId] has different [analyzer], mapper [uUserId] is used by multiple types. Set update\_all\_types to true to update [search\_analyzer] across all types., mapper [uUserId] is used by multiple types. Set update\_all\_types to true to update [search\_quote\_analyzer] across all types., mapper [uUserId] is used by multiple types. Set update\_all\_types to true to update [fielddata] across all types.]"

Settings added for index

```
ElasticsearchResponse<Stream> rRes = objClient.IndicesCreate<Stream>(strIndex, @"
                            {
                                ""settings"": {
                                    ""analysis"": {
                                        ""analyzer"": {
                                            ""Custom_Casing_Analyzer"": {
                                                ""type"": ""custom"",
                                                ""tokenizer"": ""keyword"",
                                                ""filter"": [
                                                    ""lowercase""
                                                ]
                                            }
                                        }
                                    }
                                }       
                            }");

```

mapping for uUserId

```
 ElasticsearchResponse<string> rMapping = objClient.IndicesPutMapping<string>(strIndex, strType, @"
                                        {
                                          ""properties"": {
                                                ""uUserId"": {
                                                    ""type"" : ""text"",
                                                    ""analyzer"": ""Custom_Casing_Analyzer"", 
                                                    ""search_analyzer"": ""Custom_Casing_Analyzer"",
                                                    ""fielddata"": true,
                                                    ""fields"" : {
                                                        ""keyword"" : {
                                                            ""type"" : ""keyword"",
                                                        ""ignore_above"" : 256
                                                        }
                                                    }
                                                }
                                            }
                                        }");

```

Thanks  
Aneesh L

---

<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:** [February 14, 2018, 6:44am UTC](https://discuss.elastic.co/t/conflicts-with-existing-mapping/119727/2 "2018-02-14T06:44:31Z")

</div>

Probably because your index already exists.  
Remove it first.

---

<div class="post-metadata">

**Author:** ![aneesh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aneesh/32/37819_2.png) [@aneesh](https://discuss.elastic.co/u/aneesh)\
**Post date:** [February 14, 2018, 7:13am UTC](https://discuss.elastic.co/t/conflicts-with-existing-mapping/119727/3 "2018-02-14T07:13:53Z")

</div>

I deleted the node folders from mine and copied from another system  
There index created with Custom\_Casing\_Analyzer settings.

In Kibana when i execute GET /Student/\_settings

```
{
  "Student": {
    "settings": {
      "index": {
        "number_of_shards": "5",
        "provided_name": "Student",
        "creation_date": "1518524267463",
        "analysis": {
          "analyzer": {
            "Custom_Casing_Analyzer": {
              "filter": [
                "lowercase"
              ],
              "type": "custom",
              "tokenizer": "keyword"
            }
          }
        },
        "number_of_replicas": "1",
        "uuid": "SPo0vE6OTc-K6BcYQo04rw",
        "version": {
          "created": "6010199"
        }
      }
    }
  }

```

}

But while getting data, trying to PutMapping for the column, need to avoid case check, there getting conflict issue

---

<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:** [February 14, 2018, 7:34am UTC](https://discuss.elastic.co/t/conflicts-with-existing-mapping/119727/4 "2018-02-14T07:34:28Z")

</div>

What gives:

```auto
GET /Student/_mapping

```

---

<div class="post-metadata">

**Author:** ![aneesh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aneesh/32/37819_2.png) [@aneesh](https://discuss.elastic.co/u/aneesh)\
**Post date:** [February 14, 2018, 7:44am UTC](https://discuss.elastic.co/t/conflicts-with-existing-mapping/119727/5 "2018-02-14T07:44:14Z")

</div>

Its giving default setting for all columns

```
"uUserId": {
            "type": "text",
            "fields": {
              "keyword": {
                "type": "keyword",
                "ignore_above": 256
              }
            }
          },
```

---

<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:** [February 14, 2018, 7:56am UTC](https://discuss.elastic.co/t/conflicts-with-existing-mapping/119727/6 "2018-02-14T07:56:59Z")

</div>

That's why your put mapping call is failing. You can not update an existing field.

---

<div class="post-metadata">

**Author:** ![aneesh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aneesh/32/37819_2.png) [@aneesh](https://discuss.elastic.co/u/aneesh)\
**Post date:** [February 14, 2018, 8:01am UTC](https://discuss.elastic.co/t/conflicts-with-existing-mapping/119727/7 "2018-02-14T08:01:16Z")

</div>

Any solution to add an extra property in mapping

---

<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:** [February 14, 2018, 8:34am UTC](https://discuss.elastic.co/t/conflicts-with-existing-mapping/119727/8 "2018-02-14T08:34:06Z")

</div>

If you mean : adding a new field, then that will work.  
If you mean changing an existing field: you need to reindex

---

<div class="post-metadata">

**Author:** ![aneesh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aneesh/32/37819_2.png) [@aneesh](https://discuss.elastic.co/u/aneesh)\
**Post date:** [February 14, 2018, 8:37am UTC](https://discuss.elastic.co/t/conflicts-with-existing-mapping/119727/9 "2018-02-14T08:37:47Z")

</div>

"analyzer": "Custom\_Casing\_Analyzer",  
"search\_analyzer": "Custom\_Casing\_Analyzer",

this analyzer need to add (No need to change existing mappings)  
how i can add this?

---

<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:** [February 14, 2018, 9:48am UTC](https://discuss.elastic.co/t/conflicts-with-existing-mapping/119727/10 "2018-02-14T09:48:08Z")

</div>

You **MUST** reindex.

---

<div class="post-metadata">

**Author:** ![aneesh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aneesh/32/37819_2.png) [@aneesh](https://discuss.elastic.co/u/aneesh)\
**Post date:** [February 14, 2018, 12:32pm UTC](https://discuss.elastic.co/t/conflicts-with-existing-mapping/119727/11 "2018-02-14T12:32:36Z")

</div>

while creating an index is it possible to set mapping for all columns with that analayzer?

---

<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:** [February 14, 2018, 12:56pm UTC](https://discuss.elastic.co/t/conflicts-with-existing-mapping/119727/12 "2018-02-14T12:56:37Z")

</div>

Yes.

---

<div class="post-metadata">

**Author:** ![aneesh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aneesh/32/37819_2.png) [@aneesh](https://discuss.elastic.co/u/aneesh)\
**Post date:** [February 14, 2018, 1:01pm UTC](https://discuss.elastic.co/t/conflicts-with-existing-mapping/119727/13 "2018-02-14T13:01:16Z")

</div>

How we can do that?

```
ElasticsearchResponse<Stream> rRes = objClient.IndicesCreate<Stream>(strIndex, @"
                            {
                                ""settings"": {
                                    ""analysis"": {
                                        ""analyzer"": {
                                            ""Custom_Casing_Analyzer"": {
                                                ""type"": ""custom"",
                                                ""tokenizer"": ""keyword"",
                                                ""filter"": [
                                                    ""lowercase""
                                                ]
                                            }
                                        }
                                    }
                                }       
                            }");

```

for this entity I have 10 columns, how will set for those 10 columns?

---

<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:** [February 14, 2018, 1:15pm UTC](https://discuss.elastic.co/t/conflicts-with-existing-mapping/119727/14 "2018-02-14T13:15:21Z")

</div>

```auto
DELETE test 
PUT test
{
  "settings": {
    "analysis": {
      "analyzer": {
        "Custom_Casing_Analyzer": {
          "type": "custom",
          "tokenizer": "keyword",
          "filter": [
            "lowercase"
          ]
        }
      }
    }
  },
  "mappings": {
    "doc": {
      "properties": {
        "foo1": {
          "type": "text",
          "analyzer": "Custom_Casing_Analyzer"
        },
        "foo2": {
          "type": "text",
          "analyzer": "Custom_Casing_Analyzer"
        }
      }
    }
  }
}

```

---

<div class="post-metadata">

**Author:** ![aneesh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aneesh/32/37819_2.png) [@aneesh](https://discuss.elastic.co/u/aneesh)\
**Post date:** [February 15, 2018, 3:28am UTC](https://discuss.elastic.co/t/conflicts-with-existing-mapping/119727/15 "2018-02-15T03:28:11Z")

</div>

foo1 and foo2 are the column name right?  
Is there any way to apply analyser without giving column name (apply all)?  
Because number of columns is more for the index

---

<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:** [February 15, 2018, 3:42am UTC](https://discuss.elastic.co/t/conflicts-with-existing-mapping/119727/16 "2018-02-15T03:42:31Z")

</div>

Have a look at [https://www.elastic.co/guide/en/elasticsearch/reference/6.2/dynamic-templates.html](https://www.elastic.co/guide/en/elasticsearch/reference/6.2/dynamic-templates.html)

---

<div class="post-metadata">

**Author:** ![aneesh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aneesh/32/37819_2.png) [@aneesh](https://discuss.elastic.co/u/aneesh)\
**Post date:** [February 16, 2018, 5:53am UTC](https://discuss.elastic.co/t/conflicts-with-existing-mapping/119727/17 "2018-02-16T05:53:34Z")

</div>

Thanks it worked..

But for one index when adding data got following issue

Document contains at least one immense term in field="Template.Files.de.tCertificateTemplateHTML" (whose UTF8 encoding is longer than the max length 32766), all of which were skipped. Please correct the analyzer to not produce such terms. The prefix of the first immense term is: '[60, 109, 101, 116, 97, 32, 104, 116, 116, 112, 45, 101, 113, 117, 105, 118, 61, 34, 99, 111, 110, 116, 101, 110, 116, 45, 116, 121, 112, 101]...', original message: bytes can be at most 32766 in length; got 40669

How I can increase that limit?

---

<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:** [February 16, 2018, 6:09am UTC](https://discuss.elastic.co/t/conflicts-with-existing-mapping/119727/18 "2018-02-16T06:09:12Z")

</div>

Could you share a sample document on [gist.github.com](http://gist.github.com)?

---

<div class="post-metadata">

**Author:** ![aneesh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aneesh/32/37819_2.png) [@aneesh](https://discuss.elastic.co/u/aneesh)\
**Post date:** [February 16, 2018, 7:14am UTC](https://discuss.elastic.co/t/conflicts-with-existing-mapping/119727/19 "2018-02-16T07:14:10Z")

</div>

I have some template data as HTML, that string is too long

---

<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:** [February 16, 2018, 7:53am UTC](https://discuss.elastic.co/t/conflicts-with-existing-mapping/119727/20 "2018-02-16T07:53:06Z")

</div>

Ok. So I'm going to answer without knowing a lot. My answer might be wrong.

Why do you want to use keyword tokenizer for html content?

[Next page](https://discuss.elastic.co/t/conflicts-with-existing-mapping/119727.md?page=2)
