Skip to content

Commit ba99492

Browse files
authored
Adding docs about scaled_float saturation with long values (elastic#107966) (elastic#108071)
1 parent 82bf5ae commit ba99492

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
@@ -229,6 +229,18 @@ endif::[]
229229
of `scaling_factor` improve accuracy but also increase space requirements.
230230
This parameter is required.
231231

232+
[[scaled-float-saturation]]
233+
==== `scaled_float` saturation
234+
235+
`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
236+
results in a value that is outside the range of a `long`, the value is saturated
237+
to the minimum or maximum value of a `long`. For example, if the scaling factor
238+
is +100+ and the value is +92233720368547758.08+, the expected value is +9223372036854775808+.
239+
However, the value that is stored is +9223372036854775807+, the maximum value for a `long`.
240+
241+
This can lead to unexpected results with <<query-dsl-range-query,range queries>>
242+
when the scaling factor or provided `float` value are exceptionally large.
243+
232244
[[numeric-synthetic-source]]
233245
==== Synthetic source preview:[]
234246
All numeric fields except `unsigned_long` support <<synthetic-source,synthetic

0 commit comments

Comments
 (0)