File tree Expand file tree Collapse file tree 2 files changed +2
-5
lines changed
modules/mapper-extras/src/main/java/org/elasticsearch/index/mapper/extras
x-pack/plugin/esql/qa/testFixtures/src/main/java/org/elasticsearch/xpack/esql Expand file tree Collapse file tree 2 files changed +2
-5
lines changed Original file line number Diff line number Diff line change @@ -312,8 +312,7 @@ public BlockLoader blockLoader(BlockLoaderContext blContext) {
312312 return BlockLoader .CONSTANT_NULLS ;
313313 }
314314 if (hasDocValues ()) {
315- double scalingFactorInverse = 1d / scalingFactor ;
316- return new BlockDocValuesReader .DoublesBlockLoader (name (), l -> l * scalingFactorInverse );
315+ return new BlockDocValuesReader .DoublesBlockLoader (name (), l -> l / scalingFactor );
317316 }
318317 ValueFetcher valueFetcher = sourceValueFetcher (blContext .sourcePaths (name ()));
319318 BlockSourceReader .LeafIteratorLookup lookup = isStored () || isIndexed ()
Original file line number Diff line number Diff line change @@ -660,8 +660,6 @@ private static StringBuilder trimOrPad(StringBuilder buffer) {
660660
661661 private static double scaledFloat (String value , String factor ) {
662662 double scalingFactor = Double .parseDouble (factor );
663- // this extra division introduces extra imprecision in the following multiplication, but this is how ScaledFloatFieldMapper works.
664- double scalingFactorInverse = 1d / scalingFactor ;
665- return new BigDecimal (value ).multiply (BigDecimal .valueOf (scalingFactor )).longValue () * scalingFactorInverse ;
663+ return new BigDecimal (value ).multiply (BigDecimal .valueOf (scalingFactor )).longValue () / scalingFactor ;
666664 }
667665}
You can’t perform that action at this time.
0 commit comments