Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
5.3.1
-
None
-
None
-
New
Description
When we use FloatField for sorting, decimal values are getting rounded off and results is erroneous. Even after upgrading version to 6.0.0 FloatPoint results are also erroneous. We are getting correct results only when we use field as FloatDocValues.
I have attached a sample project which can show case the bug which i encountered LuenceSortFloatIssue.zip
I debugged to see what happened internally, below are few things which i encountered.
I used the following values to sort 12.5,15,0,0,12. We can clearly see 12.5 and 12 are saved as 1.7E-44 in queue.
when we use `FloatDocValuesField` to store the value then the sorting is working as expected. we can see values are stored without rounding off in below image
Only difference i see in the file Lucene50DocValuesProducer . In case of floatPoint numeric entry format is CONST_COMPRESSED and for rest of field types like int point, long point or FloatDocValuesField the entry format is TABLE_COMPRESSED.