Skip to content

Commit eee9aa3

Browse files
ESQL: Update docs for new types (#137726)
* Update docs for new types aggregate_metric_double and dense_vector * Fix typos * Try to fix applies_to markers * Fixes * Mark conversion functions as preview * Use consistent links * Mention TO_DENSE_VECTOR * Refactor 9.2.0 type limitations and fix cross-repo links Grouped dense_vector and aggregate_metric_double limitations under single bullet with sub-bullets Added subheading "Partial support in 9.2.0" Fixed broken elasticsearch:// cross-repo links to /reference/ format Converted multi-index paragraph to bullet point Wrapped explanation in note block with bulleted examples --------- Co-authored-by: Liam Thompson <[email protected]>
1 parent 41d79dc commit eee9aa3

File tree

3 files changed

+27
-11
lines changed

3 files changed

+27
-11
lines changed

docs/reference/query-languages/esql/_snippets/lists/type-conversion-functions.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1+
* [`TO_AGGREGATE_METRIC_DOUBLE`](../../functions-operators/type-conversion-functions.md#esql-to_aggregate_metric_double) {applies_to}`stack: preview 9.2` {applies_to}`serverless: preview`
12
* [`TO_BOOLEAN`](../../functions-operators/type-conversion-functions.md#esql-to_boolean)
23
* [`TO_CARTESIANPOINT`](../../functions-operators/type-conversion-functions.md#esql-to_cartesianpoint)
34
* [`TO_CARTESIANSHAPE`](../../functions-operators/type-conversion-functions.md#esql-to_cartesianshape)
45
* [`TO_DATEPERIOD`](../../functions-operators/type-conversion-functions.md#esql-to_dateperiod)
56
* [`TO_DATETIME`](../../functions-operators/type-conversion-functions.md#esql-to_datetime)
67
* [`TO_DATE_NANOS`](../../functions-operators/type-conversion-functions.md#esql-to_date_nanos)
78
* [`TO_DEGREES`](../../functions-operators/type-conversion-functions.md#esql-to_degrees)
9+
* [`TO_DENSE_VECTOR`](../../functions-operators/type-conversion-functions.md#esql-to_dense_vector) {applies_to}`stack: preview 9.2` {applies_to}`serverless: preview`
810
* [`TO_DOUBLE`](../../functions-operators/type-conversion-functions.md#esql-to_double)
911
* [`TO_GEOHASH`](../../functions-operators/type-conversion-functions.md#esql-to_geohash) {applies_to}`stack: preview` {applies_to}`serverless: preview`
1012
* [`TO_GEOHEX`](../../functions-operators/type-conversion-functions.md#esql-to_geohex) {applies_to}`stack: preview` {applies_to}`serverless: preview`

docs/reference/query-languages/esql/functions-operators/type-conversion-functions.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ mapped_pages:
2222
:::
2323

2424

25+
:::{include} ../_snippets/functions/layout/to_aggregate_metric_double.md
26+
:::
27+
2528
:::{include} ../_snippets/functions/layout/to_boolean.md
2629
:::
2730

@@ -43,6 +46,9 @@ mapped_pages:
4346
:::{include} ../_snippets/functions/layout/to_degrees.md
4447
:::
4548

49+
:::{include} ../_snippets/functions/layout/to_dense_vector.md
50+
:::
51+
4652
:::{include} ../_snippets/functions/layout/to_double.md
4753
:::
4854

docs/reference/query-languages/esql/limitations.md

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -32,40 +32,41 @@ By default, an {{esql}} query returns up to 1,000 rows. You can increase the num
3232
* You can use `to_datetime` to cast to millisecond dates to use unsupported functions
3333

3434
* `double` (`float`, `half_float`, `scaled_float` are represented as `double`)
35+
* `dense_vector` {applies_to}`stack: preview 9.2` {applies_to}`serverless: preview`
3536
* `ip`
3637
* `keyword` [family](/reference/elasticsearch/mapping-reference/keyword.md) including `keyword`, `constant_keyword`, and `wildcard`
3738
* `int` (`short` and `byte` are represented as `int`)
3839
* `long`
3940
* `null`
4041
* `text` [family](/reference/elasticsearch/mapping-reference/text.md) including `text`, `semantic_text` and `match_only_text`
41-
* {applies_to}`stack: preview` {applies_to}`serverless: preview` `unsigned_long`
42+
* `unsigned_long` {applies_to}`stack: preview` {applies_to}`serverless: preview`
4243
* `version`
4344
* Spatial types
4445

4546
* `geo_point`
4647
* `geo_shape`
4748
* `point`
4849
* `shape`
49-
* TSDB metrics {preview}`9.2`
50-
* `counter`
51-
* `gauge`
50+
* TSDB metrics {applies_to}`stack: preview 9.2` {applies_to}`serverless: preview`
51+
* `counter`
52+
* `gauge`
5253
* `aggregate_metric_double`
5354

5455

55-
5656
### Unsupported types [_unsupported_types]
5757

5858
{{esql}} does not yet support the following field types:
5959

6060
::::{tab-set}
6161
:::{tab-item} 9.0-9.1
62+
* `dense_vector`
6263
* TSDB metrics
63-
* `counter`
64-
* `gauge`
64+
* `counter`
65+
* `gauge`
6566
* `aggregate_metric_double`
6667
:::
6768
:::{tab-item} 9.2+
68-
This limitation no longer exists and TSDB metrics are now supported (preview).
69+
This limitation no longer exists and TSDB metrics and `dense_vector` are now supported (preview).
6970
:::
7071
::::
7172
* Date/time
@@ -104,12 +105,19 @@ Some [field types](/reference/elasticsearch/mapping-reference/field-data-types.m
104105
* `cartesian_shape`
105106

106107

107-
In addition, when [querying multiple indexes](/reference/query-languages/esql/esql-multi-index.md), it’s possible for the same field to be mapped to multiple types. These fields cannot be directly used in queries or returned in results, unless they’re [explicitly converted to a single type](/reference/query-languages/esql/esql-multi-index.md#esql-multi-index-union-types).
108+
- In addition, when [querying multiple indexes](/reference/query-languages/esql/esql-multi-index.md), it’s possible for the same field to be mapped to multiple types. These fields cannot be directly used in queries or returned in results, unless they’re [explicitly converted to a single type](/reference/query-languages/esql/esql-multi-index.md#esql-multi-index-union-types).
108109

109-
* `dense_vector` field type is partially supported. [`KNN` function](elasticsearch://reference/query-languages/esql/functions-operators/dense-vector-functions.md#esql-knn) queries will work and any field data will be retrieved as part of the results. However, the type will appear as `unsupported` when the `KNN` function is not used.
110+
#### Partial support in 9.2.0
110111

111-
This means that `FROM test` will not retrieve `dense_vector` data. But, `FROM test WHERE KNN("dense_vector_field", [0, 1, 2, ...])` will retrieve data.
112+
* {applies_to}`stack: preview 9.2.0` The following types are only partially supported on 9.2.0. This is fixed in 9.2.1:
113+
* `dense_vector`: The [`KNN` function](/reference/query-languages/esql/functions-operators/dense-vector-functions.md#esql-knn) and the [`TO_DENSE_VECTOR` function](/reference/query-languages/esql/functions-operators/type-conversion-functions.md#esql-to_dense_vector) will work and any field data will be retrieved as part of the results. However, the type will appear as `unsupported` when these functions are not used.
114+
* `aggregate_metric_double`: Using the [`TO_AGGREGATE_METRIC_DOUBLE` function](/reference/query-languages/esql/functions-operators/type-conversion-functions.md#esql-to_aggregate_metric_double) will work and any field data will be retrieved as part of the results. However, the type will appear as `unsupported` if this function is not used.
112115

116+
:::{note}
117+
This means that a simple query like `FROM test` will not retrieve `dense_vector` or `aggregate_metric_double` data. However, using the appropriate functions will work:
118+
* `FROM test WHERE KNN("dense_vector_field", [0, 1, 2, ...])`
119+
* `FROM test | EVAL agm_data = TO_AGGREGATE_METRIC_DOUBLE(aggregate_metric_double_field)`
120+
:::
113121

114122
## _source availability [esql-_source-availability]
115123

0 commit comments

Comments
 (0)