# Incompatible types found in multi-mapping

**URL:** <https://discuss.elastic.co/t/incompatible-types-found-in-multi-mapping/170066>\
**Category:** Elasticsearch\
**Created:** [February 26, 2019, 8:14pm UTC](https://discuss.elastic.co/t/incompatible-types-found-in-multi-mapping/170066 "2019-02-26T20:14:44Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![bob28](https://avatars.discourse-cdn.com/v4/letter/b/8e8cbc/32.png) [@bob28](https://discuss.elastic.co/u/bob28)\
**Post date:** [February 26, 2019, 8:14pm UTC](https://discuss.elastic.co/t/incompatible-types-found-in-multi-mapping/170066/1 "2019-02-26T20:14:44Z")

</div>

Hi All,

I have elasticsearch index named as dataInfo-yyyy.mm.dd.

I am querying elasticsearch thru spark scala to get the data by searching index as dataInfo\* and its throwing error as follows:

catch exceptionorg.elasticsearch.hadoop.EsHadoopIllegalArgumentException: Incompatible types found in multi-mapping: Field [fieldName] has conflicting types of [LONG] and [INTEGER]

if I am passing index as dataInfo-2019\*, I am getting records from Elasticsearch.

when I do search just with info\*, I am facing this issue.

Could you please suggest what might be causing this incompatible types?

Thaks,  
Bob

---

<div class="post-metadata">

**Author:** ![bob28](https://avatars.discourse-cdn.com/v4/letter/b/8e8cbc/32.png) [@bob28](https://discuss.elastic.co/u/bob28)\
**Post date:** [February 28, 2019, 3:46pm UTC](https://discuss.elastic.co/t/incompatible-types-found-in-multi-mapping/170066/2 "2019-02-28T15:46:07Z")

</div>

Hi All,

Can anyone help me on this. Please let me know if you need more details to understand the issue.

Thanks.  
Bob

---

<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 28, 2019, 3:59pm UTC](https://discuss.elastic.co/t/incompatible-types-found-in-multi-mapping/170066/3 "2019-02-28T15:59:37Z")

</div>

I'm not sure but may be you did not force the mapping and let elasticsearch decide. In which case the decision which was based on the first document was maybe wrong.

You should probably create the right mapping instead.

---

<div class="post-metadata">

**Author:** ![bob28](https://avatars.discourse-cdn.com/v4/letter/b/8e8cbc/32.png) [@bob28](https://discuss.elastic.co/u/bob28)\
**Post date:** [February 28, 2019, 4:25pm UTC](https://discuss.elastic.co/t/incompatible-types-found-in-multi-mapping/170066/4 "2019-02-28T16:25:16Z")

</div>

Hi David,

Thank you for your quick response. I am new to elasticsearch and what do you mean by force the mapping? Can we force the mapping in elasticsearch and if yes, how can we do it.

Thanks,  
Bob

---

<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 28, 2019, 4:37pm UTC](https://discuss.elastic.co/t/incompatible-types-found-in-multi-mapping/170066/5 "2019-02-28T16:37:38Z")

</div>

Before sending a document you can create the index and define the mapping to use. See [https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-create-index.html#mappings](https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-create-index.html#mappings)

---

<div class="post-metadata">

**Author:** ![bob28](https://avatars.discourse-cdn.com/v4/letter/b/8e8cbc/32.png) [@bob28](https://discuss.elastic.co/u/bob28)\
**Post date:** [February 28, 2019, 7:59pm UTC](https://discuss.elastic.co/t/incompatible-types-found-in-multi-mapping/170066/6 "2019-02-28T19:59:31Z")

</div>

Thank you David for the link. We have done same thing. First we created index and then started sending documents.

Earlier we had field type as Integer and we changed that to Long .

Data we maintain in elasticsearch is for only last 30 days and I see all indexes currently present in the elasticsearch wiht type Long.

The indexes which had field type as Int is not any more in the elasticsearch.

After we upgraded to HDP 2.6 from 2.5, we started seeing this issue(we didn't change ES version).

Thank you,  
Bob

---

<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:** [March 2, 2019, 11:30am UTC](https://discuss.elastic.co/t/incompatible-types-found-in-multi-mapping/170066/7 "2019-03-02T11:30:29Z")

</div>

What does `info*` contains?

I understand that you have a `dataInfo-yyyy.mm.dd` which is generated by your spark job but how does `info*` is generated? What is its mapping?

---

<div class="post-metadata">

**Author:** ![bob28](https://avatars.discourse-cdn.com/v4/letter/b/8e8cbc/32.png) [@bob28](https://discuss.elastic.co/u/bob28)\
**Post date:** [March 5, 2019, 4:42am UTC](https://discuss.elastic.co/t/incompatible-types-found-in-multi-mapping/170066/8 "2019-03-05T04:42:33Z")

</div>

its a typo. there is no info\*

my index is dataInfo-yyyy.mm.dd

---

<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:** [March 5, 2019, 6:59am UTC](https://discuss.elastic.co/t/incompatible-types-found-in-multi-mapping/170066/9 "2019-03-05T06:59:02Z")

</div>

So can you rephrase your question ?

> if I am passing index as dataInfo-2019\*, I am getting records from Elasticsearch.
> 
> when I do search just with info\*, I am facing this issue.

---

<div class="post-metadata">

**Author:** ![bob28](https://avatars.discourse-cdn.com/v4/letter/b/8e8cbc/32.png) [@bob28](https://discuss.elastic.co/u/bob28)\
**Post date:** [March 6, 2019, 4:35am UTC](https://discuss.elastic.co/t/incompatible-types-found-in-multi-mapping/170066/10 "2019-03-06T04:35:17Z")

</div>

In my spark code I am trying to read data from index dataInfo-\* and getting following error:

catch exceptionorg.elasticsearch.hadoop.EsHadoopIllegalArgumentException: Incompatible types found in multi-mapping: Field [fieldName] has conflicting types of [LONG] and [INTEGER]

If I read data with index name as dataInfo-2019\* , I am getting the data

My question is why its nor returning data when I do search with dataInfo-\* and why it is throwing error.

Thanks,  
Bob

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [March 6, 2019, 5:43am UTC](https://discuss.elastic.co/t/incompatible-types-found-in-multi-mapping/170066/11 "2019-03-06T05:43:20Z")

</div>

My guess would be that the wildcard index pattern matches more than one index and that these indices have conflicting mappings for one or more fields.

---

<div class="post-metadata">

**Author:** ![bob28](https://avatars.discourse-cdn.com/v4/letter/b/8e8cbc/32.png) [@bob28](https://discuss.elastic.co/u/bob28)\
**Post date:** [March 12, 2019, 4:54pm UTC](https://discuss.elastic.co/t/incompatible-types-found-in-multi-mapping/170066/12 "2019-03-12T16:54:24Z")

</div>

I found the solution. When I am passing index name with "-" - hyphen, I am facing this issue.

If I am not ending with "-", search works fine

I mean dataInfo-\* is failing  
if i pass dataInfo-2\* works fine.

Thanks,  
Bob

---

<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 9, 2019, 4:54pm UTC](https://discuss.elastic.co/t/incompatible-types-found-in-multi-mapping/170066/13 "2019-04-09T16:54:25Z")

</div>

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