You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
: Whether the field value should be stored and retrievable separately from the [`_source`](/reference/elasticsearch/mapping-reference/mapping-source-field.md) field. Accepts `true` or `false` (default).
217
217
218
+
## Sorting
219
+
220
+
Sorting is not supported for any of the `range` field types. Attempting to sort by a field of type range_field will result in a `400 Bad Request` response.
221
+
For example, executing a sort query on a field of type `integer_range`,
222
+
```console
223
+
PUT idx
224
+
{
225
+
"mappings": {
226
+
"properties": {
227
+
"my_range": {
228
+
"type": "integer_range"
229
+
}
230
+
}
231
+
}
232
+
}
233
+
234
+
POST idx/_search
235
+
{
236
+
"sort": [
237
+
{
238
+
"my_range": {
239
+
"order": "asc"
240
+
}
241
+
}
242
+
]
243
+
}
244
+
```
245
+
results in the following response:
246
+
```console-result
247
+
{
248
+
"error": {
249
+
"root_cause": [
250
+
{
251
+
"type": "illegal_argument_exception",
252
+
"reason": "Sorting by range field [my_range] is not supported"
253
+
}
254
+
],
255
+
"type": "search_phase_execution_exception",
256
+
"reason": "all shards failed",
257
+
"phase": "query",
258
+
"grouped": true,
259
+
"failed_shards": [
260
+
{
261
+
"shard": 0,
262
+
"index": "idx",
263
+
"node": "7pzVSCf5TuSNZYj-N7u3tw",
264
+
"reason": {
265
+
"type": "illegal_argument_exception",
266
+
"reason": "Sorting by range field [my_range] is not supported"
267
+
}
268
+
}
269
+
],
270
+
"caused_by": {
271
+
"type": "illegal_argument_exception",
272
+
"reason": "Sorting by range field [my_range] is not supported",
273
+
"caused_by": {
274
+
"type": "illegal_argument_exception",
275
+
"reason": "Sorting by range field [my_range] is not supported"
Copy file name to clipboardExpand all lines: docs/reference/elasticsearch/mapping-reference/sparse-vector.md
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -26,7 +26,7 @@ PUT my-index
26
26
27
27
## Token pruning
28
28
```{applies_to}
29
-
stack: preview 9.1
29
+
stack: ga 9.1
30
30
```
31
31
32
32
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:
@@ -63,23 +63,23 @@ The following parameters are accepted by `sparse_vector` fields:
63
63
* Exclude the field from [_source](/reference/elasticsearch/rest-apis/retrieve-selected-fields.md#source-filtering).
64
64
* Use [synthetic `_source`](/reference/elasticsearch/mapping-reference/mapping-source-field.md#synthetic-source).
65
65
66
-
index_options {applies_to}`stack: preview 9.1`
66
+
index_options {applies_to}`stack: ga 9.1`
67
67
: (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.
68
68
69
69
Parameters for `index_options` are:
70
70
71
-
`prune` {applies_to}`stack: preview 9.1`
71
+
`prune` {applies_to}`stack: ga 9.1`
72
72
: (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.
73
73
74
-
`pruning_config` {applies_to}`stack: preview 9.1`
74
+
`pruning_config` {applies_to}`stack: ga 9.1`
75
75
: (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.
`tokens_freq_ratio_threshold` {applies_to}`stack: ga 9.1`
80
80
: (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: ga 9.1`
83
83
: (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`.
0 commit comments