Incompatible types found in multi-mapping

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

Hi All,

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

Thanks.
Bob

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.

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

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

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

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?

its a typo. there is no info*

my index is dataInfo-yyyy.mm.dd

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.

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

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.

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

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