New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
java.lang.ClassCastException when "properties" set to [] #5887
Comments
Yeah, this affected me as well, took a bit of time to track down to the root cause. |
Aye, it should be fixed. I think that purposed solution might not make sense, because we need to raise a failure if an array is provided with values in properties, but maybe we can optimize for the array with 0 elements type case. |
fixed in upcoming 1.2, see #6006 |
could you also change src/main/java/org/elasticsearch/index/mapper/core/TypeParsers.java (line 66) to support empty array for "fields"?
|
Some languages (e.g. PHP) don't have Map type just Array, so if "properties" or "fields" in mapping are empty - encoding it to json will result in array [], and not object {}
until 0.9 this was not an issue, but now elasticsearch refuses to create mapping with exception:
sample mapping:
this issue could be resolved by adding addition check to see if fieldNode is instance of Map:
The text was updated successfully, but these errors were encountered: