Failed to put mappings on indices:cannot be changed from type [float] to [long]

sometimes we got such exception on ES log :[customFields.ext_default_UDF104547548283008] cannot be changed from type [float] to [long].
And these field were from user input, the data can be float or long, why ES will raise this error?

They are two different structures, you can't convert between them without losing some of the contents of a float value.

OK thanks.
so, you mean this exception just tell me there some content lose, but the whole document still update successfully?

No, it rejects the doc.

ok, thanks. I have no idea how to fix it. Like the inner field below, next time the value maybe changed to 100.00, i should make it save successfully.

"ext_default_UDF105095590305856": {
"value": 100,
"currency": "USD"
},

You need to normalise it before sending to ES.

It's not easy to do that, since the filed name is dynamic too. :frowning:

Having dynamic field names like that can be very inefficient and cause problems in the form of mapping explosion unless the expected number of dynamically generated fields is low.

2 Likes

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