Actually, I've had a good mess about with 'coerce' and here is how it is behaving in 5.5:
indexing a value of "1" will succeed. Indexing a value of 1.1 will succeed. However, "1.0" (or "1.any digit") will fail.
You can see from the relevant code block that this is how it is coded to work (if the value is a string, coerce is apparently ignored altogether, it just tries to parse it)....
I'm not certain that is right, so I have opened this issue to suss it out
We were just chatting about this internally and I was about to open an issue as well
The behavior is a bit surprising (for me too). The behavior is basically what you described:
Floating numerics are truncated
Integral strings are converted via string parsing
Floating strings fail, because the integral string parsing bit doesn't know how to deal with them and we don't do anything to truncate the .xxx portion (or cast to double first and check to see if integral like we do in the numeric portion)
Cool bananas, thanks Zachary... Agreed it looks pretty fixable; I'm happy to volunteer my assistance, though I currently have no dev env standing up with the appropriate tooling or anything
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.