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


(Compasses) #1

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?


(Mark Walkom) #2

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


(Compasses) #3

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


(Mark Walkom) #4

No, it rejects the doc.


(Compasses) #5

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"
},


(Mark Walkom) #6

You need to normalise it before sending to ES.


(Compasses) #7

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


(Christian Dahlqvist) #8

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.


(system) #9

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