Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 5 additions & 8 deletions docs/reference/elasticsearch/mapping-reference/sparse-vector.md
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe @leemthompo can answer this better but do we still want the applies to, but just not the preview notation?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct @kderusso the applies_to tags are what we need to distinguish features that aren't available in 9.0, it's not just about flagging their lifecycle

So basically if something new arrives in a minor, it needs applies_to and the docs are now cumulative: we don't delete information, we add information and mark it up appropriately.

We don't have a separate page for 9.0, 9.1, 9.2 etc. so we need this because it's all one page :)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tl;dr @markjhoy you need to maintain the applies_to's but just s/preview/ga/g

Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@ PUT my-index
```

## Token pruning
```{applies_to}
stack: preview 9.1
```

With any new indices created, token pruning will be turned on by default with appropriate defaults. You can control this behaviour using the optional `index_options` parameters for the field:

Expand Down Expand Up @@ -63,23 +60,23 @@ The following parameters are accepted by `sparse_vector` fields:
* Exclude the field from [_source](/reference/elasticsearch/rest-apis/retrieve-selected-fields.md#source-filtering).
* Use [synthetic `_source`](/reference/elasticsearch/mapping-reference/mapping-source-field.md#synthetic-source).

index_options {applies_to}`stack: preview 9.1`
index_options
: (Optional, object) You can set index options for your `sparse_vector` field to determine if you should prune tokens, and the parameter configurations for the token pruning. If pruning options are not set in your [`sparse_vector` query](/reference/query-languages/query-dsl/query-dsl-sparse-vector-query.md), Elasticsearch will use the default options configured for the field, if any.

Parameters for `index_options` are:

`prune` {applies_to}`stack: preview 9.1`
`prune`
: (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: true.

`pruning_config` {applies_to}`stack: preview 9.1`
`pruning_config`
: (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. If `prune` is set to false but `pruning_config` is specified, an exception will occur.

Parameters for `pruning_config` include:

`tokens_freq_ratio_threshold` {applies_to}`stack: preview 9.1`
`tokens_freq_ratio_threshold`
: (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` {applies_to}`stack: preview 9.1`
`tokens_weight_threshold`
: (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`.

::::{note}
Expand Down
Loading