# Issue in creating mapping with \_all field having different analyzer though in different index

**URL:** <https://discuss.elastic.co/t/issue-in-creating-mapping-with--all-field-having-different-analyzer-though-in-different-index/80572>\
**Category:** Elasticsearch\
**Created:** [March 30, 2017, 1:28am UTC](https://discuss.elastic.co/t/issue-in-creating-mapping-with--all-field-having-different-analyzer-though-in-different-index/80572 "2017-03-30T01:28:52Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![sknaved](https://avatars.discourse-cdn.com/v4/letter/s/46a35a/32.png) [@sknaved](https://discuss.elastic.co/u/sknaved)\
**Post date:** [March 30, 2017, 1:28am UTC](https://discuss.elastic.co/t/issue-in-creating-mapping-with--all-field-having-different-analyzer-though-in-different-index/80572/1 "2017-03-30T01:28:52Z")

</div>

I am stucked with below problem in production. Could you help me solve this

In Production i have two indices "hs" and "hsproduct".  
In index "hs", i have type "product" whose mapping contains "\_all" to some custom analyzer1. In index "hsproduct", i have type with same name as "product".  
The issue when i try to PUT mapping file for type "product" in index "hsproduct" with \_all analyzer as different "analyzer2", it gives me below error as

{"error":{"root\_cause":[{"type":"illegal\_argument\_exception","reason":"Mapper for [\_all] conflicts with existing mapping in other types:\n[mapper [\_all] has different [analyzer], mapper [\_all] is used by multiple types. Set update\_all\_types to true to update [search\_analyzer] across all types., mapper [\_all] is used by multiple types. Set update\_all\_types to true to update [search\_quote\_analyzer] across all types.]"}],"type":"illegal\_argument\_exception","reason":"Mapper for [\_all] conflicts with existing mapping in other types:\n[mapper [\_all] has different [analyzer], mapper [\_all] is used by multiple types. Set update\_all\_types to true to update [search\_analyzer] across all types., mapper [\_all] is used by multiple types. Set update\_all\_types to true to update [search\_quote\_analyzer] across all types.]"},"status":400}

Does this mean that \_all field is shared across indices and i cannot use different analyzer though in different index.

Kinldy, help me solve this as it is in Production and i am stucked with no clue.

Thanks,  
Naved

---

<div class="post-metadata">

**Author:** ![johtani](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/johtani/32/44956_2.png) [@johtani](https://discuss.elastic.co/u/johtani)\
**Post date:** [March 30, 2017, 7:56am UTC](https://discuss.elastic.co/t/issue-in-creating-mapping-with--all-field-having-different-analyzer-though-in-different-index/80572/2 "2017-03-30T07:56:27Z")

</div>

See [https://www.elastic.co/guide/en/elasticsearch/guide/2.x/mapping-intro.html#updating-a-mapping](https://www.elastic.co/guide/en/elasticsearch/guide/2.x/mapping-intro.html#updating-a-mapping)

You can't change existing field mappings.  
If you want to change \_all field settings, you can only define when the index create.  
You can use different analyzer each indices.

---

<div class="post-metadata">

**Author:** ![sknaved](https://avatars.discourse-cdn.com/v4/letter/s/46a35a/32.png) [@sknaved](https://discuss.elastic.co/u/sknaved)\
**Post date:** [March 30, 2017, 12:03pm UTC](https://discuss.elastic.co/t/issue-in-creating-mapping-with--all-field-having-different-analyzer-though-in-different-index/80572/3 "2017-03-30T12:03:20Z")

</div>

> [@johtani](#):
>
> [Mapping | Elasticsearch: The Definitive Guide [2.x] | Elastic](https://www.elastic.co/guide/en/elasticsearch/guide/2.x/mapping-intro.html#updating-a-mapping)

Thank You Jun.  
I'll try out with your suggestion.

---

<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:** [April 27, 2017, 12:03pm UTC](https://discuss.elastic.co/t/issue-in-creating-mapping-with--all-field-having-different-analyzer-though-in-different-index/80572/4 "2017-04-27T12:03:26Z")

</div>

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