In ElasticSearch 5, we now get the following error message [DEPRECATION] 299 Elasticsearch-5.4.0-780f8c4 "Expected a boolean [true/false] for property [isAnonymous] but got [0]" (isAnonymous is just a field name we use)
However, there is no such thing as a boolean in perl.
Until now we passed 0/1, for those.. which worked fine. But.. now, since the shift to 5, we get this message, which probably means bad news.
Note: There is no Boolean in perl. so basically ES is expecting something that doesn't exist in the language it officially supports.
(am I missing something?)
You can use the "true" / "false" strings - it works just fine, and I don't get any deprecation warnings using them:
PUT t
{
"mappings": {
"t": {
"properties": {
"foo": {
"type": "boolean"
}
}
}
}
}
PUT t/t/1
{
"foo": "true"
}
That said, the various JSON encoders in Perl provide objects which represent Booleans - the names differ depending on the encoder you use. When decoding JSON, they'll return an object like JSON::PP::Boolean which work as true & false. When encoding JSON, you can represent true as \1 and false as \0. You can also use JSON::true, JSON::false from the JSON module, or Types::Serializer::true and Types::Serializer::false from Types::Serializer, which is used by JSON::XS.
It doesn't matter which one you use - these modules interact just fine.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.