From 067c94e168c5077f3211685fd1c520b5555abdab Mon Sep 17 00:00:00 2001 From: Asim Mahmood Date: Sun, 3 Aug 2025 23:10:00 -0700 Subject: [PATCH 1/3] Add skip_list parameter to numeric field type (default: false) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Added Parameter Documentation * Added Practical Example, and when its useful to enable • Applies to all numeric field types (byte, short, integer, long, float, double, half_float, unsigned_long) Signed-off-by: Asim Mahmood --- _field-types/supported-field-types/numeric.md | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/_field-types/supported-field-types/numeric.md b/_field-types/supported-field-types/numeric.md index 9f56d6a9cf8..5e7ed347a5d 100644 --- a/_field-types/supported-field-types/numeric.md +++ b/_field-types/supported-field-types/numeric.md @@ -59,6 +59,37 @@ PUT testindex/_doc/1 ``` {% include copy-curl.html %} +## Skip list example + +Create a mapping with skip list indexing enabled for better range query performance: + +```json +PUT testindex_skiplist +{ + "mappings" : { + "properties" : { + "price" : { + "type" : "double", + "skip_list" : true + } + } + } +} +``` +{% include copy-curl.html %} + +Index documents with numeric values: + +```json +PUT testindex_skiplist/_doc/1 +{ + "price" : 19.99 +} +``` +{% include copy-curl.html %} + +The `skip_list` parameter is particularly beneficial for fields that are frequently used in range queries or aggregations, as it allows the query engine to skip over document ranges that don't match the query criteria. + ## Scaled float field type A scaled float field type is a floating-point value that is multiplied by the scale factor and stored as a long value. It takes all optional parameters taken by number field types, plus an additional scaling_factor parameter. The scale factor is required when creating a scaled float. @@ -110,6 +141,7 @@ Parameter | Description `index` | A Boolean value that specifies whether the field should be searchable. Default is `true`. `meta` | Accepts metadata for this field. [`null_value`]({{site.url}}{{site.baseurl}}/opensearch/supported-field-types/index#null-value) | A value to be used in place of `null`. Must be of the same type as the field. If this parameter is not specified, the field is treated as missing when its value is `null`. Default is `null`. +`skip_list` | A Boolean value that specifies whether to enable skip list indexing for doc values. When enabled, this creates indexed doc values that can improve performance for range queries and aggregations by allowing the query engine to skip over irrelevant document ranges. Default is `false`. `store` | A Boolean value that specifies whether the field value should be stored and can be retrieved separately from the _source field. Default is `false`. Scaled float has an additional required parameter: `scaling_factor`. From 824cb788fc7c11f0fdb4bebfdba5a4ebedffad35 Mon Sep 17 00:00:00 2001 From: Asim M Date: Mon, 4 Aug 2025 14:45:56 -0700 Subject: [PATCH 2/3] Apply suggestions from code review Co-authored-by: kolchfa-aws <105444904+kolchfa-aws@users.noreply.github.com> Signed-off-by: Asim M --- _field-types/supported-field-types/numeric.md | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/_field-types/supported-field-types/numeric.md b/_field-types/supported-field-types/numeric.md index 5e7ed347a5d..2562ab07c9c 100644 --- a/_field-types/supported-field-types/numeric.md +++ b/_field-types/supported-field-types/numeric.md @@ -59,12 +59,14 @@ PUT testindex/_doc/1 ``` {% include copy-curl.html %} -## Skip list example +## Example: Skip list -Create a mapping with skip list indexing enabled for better range query performance: +Use the `skip_list` parameter for better query performance. The `skip_list` parameter is particularly beneficial for fields that are frequently used in `range` queries or aggregations, because it allows the query engine to skip over document ranges that don't match the query criteria. + +Create a mapping with skip list indexing enabled: ```json -PUT testindex_skiplist +PUT /testindex_skiplist { "mappings" : { "properties" : { @@ -78,7 +80,7 @@ PUT testindex_skiplist ``` {% include copy-curl.html %} -Index documents with numeric values: +Index a document containing a numeric value: ```json PUT testindex_skiplist/_doc/1 @@ -88,7 +90,6 @@ PUT testindex_skiplist/_doc/1 ``` {% include copy-curl.html %} -The `skip_list` parameter is particularly beneficial for fields that are frequently used in range queries or aggregations, as it allows the query engine to skip over document ranges that don't match the query criteria. ## Scaled float field type From 47d94c075f53ac3bb6f6da5fb82a37cb1baaa4a3 Mon Sep 17 00:00:00 2001 From: Nathan Bower Date: Tue, 5 Aug 2025 12:55:48 -0400 Subject: [PATCH 3/3] Apply suggestions from code review Signed-off-by: Nathan Bower --- _field-types/supported-field-types/numeric.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/_field-types/supported-field-types/numeric.md b/_field-types/supported-field-types/numeric.md index 2562ab07c9c..f50773d2372 100644 --- a/_field-types/supported-field-types/numeric.md +++ b/_field-types/supported-field-types/numeric.md @@ -61,7 +61,7 @@ PUT testindex/_doc/1 ## Example: Skip list -Use the `skip_list` parameter for better query performance. The `skip_list` parameter is particularly beneficial for fields that are frequently used in `range` queries or aggregations, because it allows the query engine to skip over document ranges that don't match the query criteria. +Use the `skip_list` parameter for better query performance. The `skip_list` parameter is particularly beneficial for fields that are frequently used in `range` queries or aggregations because it allows the query engine to skip over document ranges that don't match the query criteria. Create a mapping with skip list indexing enabled: @@ -142,7 +142,7 @@ Parameter | Description `index` | A Boolean value that specifies whether the field should be searchable. Default is `true`. `meta` | Accepts metadata for this field. [`null_value`]({{site.url}}{{site.baseurl}}/opensearch/supported-field-types/index#null-value) | A value to be used in place of `null`. Must be of the same type as the field. If this parameter is not specified, the field is treated as missing when its value is `null`. Default is `null`. -`skip_list` | A Boolean value that specifies whether to enable skip list indexing for doc values. When enabled, this creates indexed doc values that can improve performance for range queries and aggregations by allowing the query engine to skip over irrelevant document ranges. Default is `false`. +`skip_list` | A Boolean value that specifies whether to enable skip list indexing for doc values. When enabled, this creates indexed doc values that can improve performance for `range` queries and aggregations by allowing the query engine to skip over irrelevant document ranges. Default is `false`. `store` | A Boolean value that specifies whether the field value should be stored and can be retrieved separately from the _source field. Default is `false`. Scaled float has an additional required parameter: `scaling_factor`.