From caf464dc614cdce790099ecd5f5371896d4783f8 Mon Sep 17 00:00:00 2001 From: "Mark J. Hoy" Date: Tue, 3 Jun 2025 13:37:56 -0400 Subject: [PATCH 1/5] remove [preview] labels sparse vec / token pruning --- .../query-dsl/query-dsl-sparse-vector-query.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/reference/query-languages/query-dsl/query-dsl-sparse-vector-query.md b/docs/reference/query-languages/query-dsl/query-dsl-sparse-vector-query.md index cbd691f0fd78c..ad450a1276f15 100644 --- a/docs/reference/query-languages/query-dsl/query-dsl-sparse-vector-query.md +++ b/docs/reference/query-languages/query-dsl/query-dsl-sparse-vector-query.md @@ -63,21 +63,21 @@ GET _search : (Optional, dictionary) A dictionary of token-weight pairs representing the precomputed query vector to search. Searching using this query vector will bypass additional inference. Only one of `inference_id` and `query_vector` is allowed. `prune` -: (Optional, boolean) [preview] Whether to perform pruning, omitting the non-significant tokens from the query to improve query performance. If `prune` is true but the `pruning_config` is not specified, pruning will occur but default values will be used. Default: false. +: (Optional, boolean) Whether to perform pruning, omitting the non-significant tokens from the query to improve query performance. If `prune` is true but the `pruning_config` is not specified, pruning will occur but default values will be used. Default: false. `pruning_config` -: (Optional, object) [preview] Optional pruning configuration. If enabled, this will omit non-significant tokens from the query in order to improve query performance. This is only used if `prune` is set to `true`. If `prune` is set to `true` but `pruning_config` is not specified, default values will be used. +: (Optional, object) Optional pruning configuration. If enabled, this will omit non-significant tokens from the query in order to improve query performance. This is only used if `prune` is set to `true`. If `prune` is set to `true` but `pruning_config` is not specified, default values will be used. Parameters for `pruning_config` are: `tokens_freq_ratio_threshold` - : (Optional, integer) [preview] Tokens whose frequency is more than `tokens_freq_ratio_threshold` times the average frequency of all tokens in the specified field are considered outliers and pruned. This value must between 1 and 100. Default: `5`. + : (Optional, integer) Tokens whose frequency is more than `tokens_freq_ratio_threshold` times the average frequency of all tokens in the specified field are considered outliers and pruned. This value must between 1 and 100. Default: `5`. `tokens_weight_threshold` - : (Optional, float) [preview] Tokens whose weight is less than `tokens_weight_threshold` are considered insignificant and pruned. This value must be between 0 and 1. Default: `0.4`. + : (Optional, float) Tokens whose weight is less than `tokens_weight_threshold` are considered insignificant and pruned. This value must be between 0 and 1. Default: `0.4`. `only_score_pruned_tokens` - : (Optional, boolean) [preview] If `true` we only input pruned tokens into scoring, and discard non-pruned tokens. It is strongly recommended to set this to `false` for the main query, but this can be set to `true` for a rescore query to get more relevant results. Default: `false`. + : (Optional, boolean) If `true` we only input pruned tokens into scoring, and discard non-pruned tokens. It is strongly recommended to set this to `false` for the main query, but this can be set to `true` for a rescore query to get more relevant results. Default: `false`. ::::{note} The default values for `tokens_freq_ratio_threshold` and `tokens_weight_threshold` were chosen based on tests using ELSERv2 that provided the most optimal results. @@ -198,7 +198,7 @@ GET my-index/_search ## Example ELSER query with pruning configuration and rescore [sparse-vector-query-with-pruning-config-and-rescore-example] -The following is an extension to the above example that adds a [preview] pruning configuration to the `sparse_vector` query. The pruning configuration identifies non-significant tokens to prune from the query in order to improve query performance. +The following is an extension to the above example that adds a pruning configuration to the `sparse_vector` query. The pruning configuration identifies non-significant tokens to prune from the query in order to improve query performance. Token pruning happens at the shard level. While this should result in the same tokens being labeled as insignificant across shards, this is not guaranteed based on the composition of each shard. Therefore, if you are running `sparse_vector` with a `pruning_config` on a multi-shard index, we strongly recommend adding a [Rescore filtered search results](/reference/elasticsearch/rest-apis/filter-search-results.md#rescore) function with the tokens that were originally pruned from the query. This will help mitigate any shard-level inconsistency with pruned tokens and provide better relevance overall. From c7fac1ead4b31a09122267cecc798b913ba41436 Mon Sep 17 00:00:00 2001 From: "Mark J. Hoy" Date: Tue, 3 Jun 2025 13:41:29 -0400 Subject: [PATCH 2/5] Update docs/changelog/128854.yaml --- docs/changelog/128854.yaml | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 docs/changelog/128854.yaml diff --git a/docs/changelog/128854.yaml b/docs/changelog/128854.yaml new file mode 100644 index 0000000000000..9b8d556c41cc2 --- /dev/null +++ b/docs/changelog/128854.yaml @@ -0,0 +1,12 @@ +pr: 128854 +summary: Mark Token Pruning for Sparse Vector as GA +area: Relevance +type: docs +issues: [] +highlight: + title: Mark Token Pruning for Sparse Vector as GA + body: |- + A docs change to remove the [preview] labels for the token pruning + configuration items for the Sparse Vector query as we get ready to put + these into GA. + notable: true From 188e0da512c6f1f74b05a33836a876f3f8113f37 Mon Sep 17 00:00:00 2001 From: "Mark J. Hoy" Date: Tue, 3 Jun 2025 14:08:02 -0400 Subject: [PATCH 3/5] update changelog --- docs/changelog/128854.yaml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/docs/changelog/128854.yaml b/docs/changelog/128854.yaml index 9b8d556c41cc2..a1dfc9af7bcb1 100644 --- a/docs/changelog/128854.yaml +++ b/docs/changelog/128854.yaml @@ -1,12 +1,11 @@ pr: 128854 -summary: Mark Token Pruning for Sparse Vector as GA +summary: Mark token pruning for sparse vector as GA area: Relevance type: docs issues: [] highlight: title: Mark Token Pruning for Sparse Vector as GA body: |- - A docs change to remove the [preview] labels for the token pruning - configuration items for the Sparse Vector query as we get ready to put - these into GA. + Token pruning for sparse_vector queries has been live since 8.13 as tech preview. + As of 8.19.0 and 9.1.0, this is now generally available. notable: true From c18afd85c52f47d483bd7b3d118ea402c308c23a Mon Sep 17 00:00:00 2001 From: "Mark J. Hoy" Date: Tue, 3 Jun 2025 16:40:06 -0400 Subject: [PATCH 4/5] set changelog to feature/ml --- docs/changelog/128854.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/changelog/128854.yaml b/docs/changelog/128854.yaml index a1dfc9af7bcb1..c60c367fa6a04 100644 --- a/docs/changelog/128854.yaml +++ b/docs/changelog/128854.yaml @@ -1,7 +1,7 @@ pr: 128854 summary: Mark token pruning for sparse vector as GA -area: Relevance -type: docs +area: ml +type: feature issues: [] highlight: title: Mark Token Pruning for Sparse Vector as GA From d58d4417a8cd38b6a1908d7f451e9dd824bae334 Mon Sep 17 00:00:00 2001 From: "Mark J. Hoy" Date: Tue, 3 Jun 2025 17:11:38 -0400 Subject: [PATCH 5/5] set proper area --- docs/changelog/128854.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/changelog/128854.yaml b/docs/changelog/128854.yaml index c60c367fa6a04..65ef8829e4418 100644 --- a/docs/changelog/128854.yaml +++ b/docs/changelog/128854.yaml @@ -1,6 +1,6 @@ pr: 128854 summary: Mark token pruning for sparse vector as GA -area: ml +area: Machine Learning type: feature issues: [] highlight: