From 1b1e55aa381ff1c53a2d434994a57b3165fabce1 Mon Sep 17 00:00:00 2001 From: Benjamin Trent Date: Tue, 30 Apr 2024 08:25:37 -0400 Subject: [PATCH] Adding docs about scaled_float saturation with long values (#107966) (cherry picked from commit 67748cf616a17793ae2e559cc2bd90841295841c) --- docs/reference/mapping/types/numeric.asciidoc | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/docs/reference/mapping/types/numeric.asciidoc b/docs/reference/mapping/types/numeric.asciidoc index f33bbb99201c0..7ce29869679bc 100644 --- a/docs/reference/mapping/types/numeric.asciidoc +++ b/docs/reference/mapping/types/numeric.asciidoc @@ -233,3 +233,16 @@ numeric field can't be both a time series dimension and a time series metric. sorting) will behave as if the document had a value of +2.3+. High values of `scaling_factor` improve accuracy but also increase space requirements. This parameter is required. + +[[scaled-float-saturation]] +==== `scaled_float` saturation + +`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 +results in a value that is outside the range of a `long`, the value is saturated +to the minimum or maximum value of a `long`. For example, if the scaling factor +is +100+ and the value is +92233720368547758.08+, the expected value is +9223372036854775808+. +However, the value that is stored is +9223372036854775807+, the maximum value for a `long`. + +This can lead to unexpected results with <> +when the scaling factor or provided `float` value are exceptionally large. +