Skip to content

Commit ac2b3a5

Browse files
float and double field type don’t accept special values like NaN nor Infinity (opensearch-project#9205)
According to [IEEE 754 floating point numbers support special values like NaN nor Infinity](https://en.wikipedia.org/wiki/Floating-point_arithmetic#IEEE_754:_floating_point_in_modern_computers). OpenSearch does not support them. This change adds this restriction to the documentation for the supported datatypes. Note that this restriction should also apply to half_float but this is not explicitly documented. elastic/elasticsearch#27653 This change was still done under [Apache-2.0](https://github.com/cbuescher/elasticsearch/blob/2d7f0089ee3a924156905aaeedde5c50bc50ec2d/LICENSE.txt) so copy-paste should be no issue. Signed-off-by: Robin Schneider <[email protected]> Co-authored-by: kolchfa-aws <[email protected]>
1 parent 849a3ad commit ac2b3a5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

_field-types/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ Type | Description
2828
:--- | :---
2929
`null` | A `null` field can't be indexed or searched. When a field is set to null, OpenSearch behaves as if the field has no value.
3030
`boolean` | OpenSearch accepts `true` and `false` as Boolean values. An empty string is equal to `false.`
31-
`float` | A single-precision, 32-bit floating-point number.
32-
`double` | A double-precision, 64-bit floating-point number.
31+
`float` | A single-precision, 32-bit IEEE 754 floating-point number, restricted to finite values.
32+
`double` | A double-precision, 64-bit IEEE 754 floating-point number, restricted to finite values.
3333
`integer` | A signed 32-bit number.
3434
`object` | Objects are standard JSON objects, which can have fields and mappings of their own. For example, a `movies` object can have additional properties such as `title`, `year`, and `director`.
3535
`array` | OpenSearch does not have a specific array data type. Arrays are represented as a set of values of the same data type (for example, integers or strings) associated with a field. When indexing, you can pass multiple values for a field, and OpenSearch will treat it as an array. Empty arrays are valid and recognized as array fields with zero elements---not as fields with no values. OpenSearch supports querying and filtering arrays, including checking for values, range queries, and array operations like concatenation and intersection. Nested arrays, which may contain complex objects or other arrays, can also be used for advanced data modeling.

0 commit comments

Comments
 (0)