File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
nitrite/src/main/java/org/dizitart/no2/common Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ private DBValue() {
4242 }
4343
4444 public DBValue (Comparable <?> value ) {
45- this .value = value ;
45+ this .value = normalizeNumber ( value ) ;
4646 }
4747
4848 @ Override
@@ -58,6 +58,15 @@ public int compareTo(DBValue o) {
5858 return Comparables .compare (value , o .value );
5959 }
6060
61+ private static Comparable <?> normalizeNumber (Comparable <?> value ) {
62+ // Normalize all numeric types to Double for consistent serialization
63+ // This ensures Integer(5) and Double(5.0) are treated the same in indexes
64+ if (value instanceof Number && !(value instanceof Double )) {
65+ return ((Number ) value ).doubleValue ();
66+ }
67+ return value ;
68+ }
69+
6170 private void writeObject (ObjectOutputStream stream ) throws IOException {
6271 stream .writeObject (value );
6372 }
You can’t perform that action at this time.
0 commit comments