Skip to content

Commit 8b55b21

Browse files
authored
Adding docs about scaled_float saturation with long values (#107966) (#108083)
(cherry picked from commit 67748cf)
1 parent 5bcbce3 commit 8b55b21

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

docs/reference/mapping/types/numeric.asciidoc

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,3 +233,16 @@ numeric field can't be both a time series dimension and a time series metric.
233233
sorting) will behave as if the document had a value of +2.3+. High values
234234
of `scaling_factor` improve accuracy but also increase space requirements.
235235
This parameter is required.
236+
237+
[[scaled-float-saturation]]
238+
==== `scaled_float` saturation
239+
240+
`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
241+
results in a value that is outside the range of a `long`, the value is saturated
242+
to the minimum or maximum value of a `long`. For example, if the scaling factor
243+
is +100+ and the value is +92233720368547758.08+, the expected value is +9223372036854775808+.
244+
However, the value that is stored is +9223372036854775807+, the maximum value for a `long`.
245+
246+
This can lead to unexpected results with <<query-dsl-range-query,range queries>>
247+
when the scaling factor or provided `float` value are exceptionally large.
248+

0 commit comments

Comments
 (0)