Skip to content

Commit 11db216

Browse files
authored
Adding docs about scaled_float saturation with long values (elastic#107966) (elastic#108074)
1 parent a7d39eb commit 11db216

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

docs/reference/mapping/types/numeric.asciidoc

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,18 @@ numeric field can't be both a time series dimension and a time series metric.
227227
of `scaling_factor` improve accuracy but also increase space requirements.
228228
This parameter is required.
229229

230+
[[scaled-float-saturation]]
231+
==== `scaled_float` saturation
232+
233+
`scaled_float` is stored as a single `long` value, which is the product of multiplying the original value by the scaling factor. If the multiplication
234+
results in a value that is outside the range of a `long`, the value is saturated
235+
to the minimum or maximum value of a `long`. For example, if the scaling factor
236+
is +100+ and the value is +92233720368547758.08+, the expected value is +9223372036854775808+.
237+
However, the value that is stored is +9223372036854775807+, the maximum value for a `long`.
238+
239+
This can lead to unexpected results with <<query-dsl-range-query,range queries>>
240+
when the scaling factor or provided `float` value are exceptionally large.
241+
230242
[[numeric-synthetic-source]]
231243
==== Synthetic `_source`
232244

0 commit comments

Comments
 (0)