# Elasticsearch illegal\_argument\_exception error

**URL:** <https://discuss.elastic.co/t/elasticsearch-illegal-argument-exception-error/125110>\
**Category:** Elasticsearch\
**Created:** [March 22, 2018, 6:24am UTC](https://discuss.elastic.co/t/elasticsearch-illegal-argument-exception-error/125110 "2018-03-22T06:24:15Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![sameera207](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sameera207/32/29120_2.png) [@sameera207](https://discuss.elastic.co/u/sameera207)\
**Post date:** [March 22, 2018, 6:24am UTC](https://discuss.elastic.co/t/elasticsearch-illegal-argument-exception-error/125110/1 "2018-03-22T06:24:15Z")

</div>

Hi All,

I'm working on a rails 5.0.6 project with Elasticsearch 2.4. I'm using [searchkick](https://github.com/ankane/searchkick). My question is, I'm getting the following error when I try to reindex. (I understand some of the values in the error is maybe specific to my case)

`{"type"=>"illegal_argument_exception", "reason"=>"Mapper for [body] conflicts with existing mapping in other types:\n[mapper [body] has different [index] values, mapper [body] has different [analyzer], mapper [body] is used by multiple types. Set update_all_types to true to update [search_analyzer] across all types., mapper [body] is used by multiple types. Set update_all_types to true to update [search_quote_analyzer] across all types.]"}`

Can someone please explain me this error on what it means and help me to understand what might be causing this issue. Then I can check the code and fix it.

I have found some articles on the web, but still not fully understand what causing the error

thanks in advance,

I've posted the same question in [SO](https://stackoverflow.com/questions/49421936/elasticsearch-illegal-argument-exception-error) too

cheers,

Sam

---

<div class="post-metadata">

**Author:** ![thiago](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/thiago/32/32096_2.png) [@thiago](https://discuss.elastic.co/u/thiago)\
**Post date:** [March 22, 2018, 6:37am UTC](https://discuss.elastic.co/t/elasticsearch-illegal-argument-exception-error/125110/2 "2018-03-22T06:37:49Z")

</div>

This means that multiple types within the same index has fields with same name but with conflicting field mapping. You need to inspect the types within the same index and make sure that all mappings with the same field name, between different types, are all equal.

This is one of the reasons that types has been deprecated.

---

<div class="post-metadata">

**Author:** ![sameera207](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sameera207/32/29120_2.png) [@sameera207](https://discuss.elastic.co/u/sameera207)\
**Post date:** [March 25, 2018, 10:44pm UTC](https://discuss.elastic.co/t/elasticsearch-illegal-argument-exception-error/125110/3 "2018-03-25T22:44:35Z")

</div>

hey @thiago, thanks I'll check the indexes

---

<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 22, 2018, 10:44pm UTC](https://discuss.elastic.co/t/elasticsearch-illegal-argument-exception-error/125110/4 "2018-04-22T22:44:55Z")

</div>

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