Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
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

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
* [`KNN`](../../functions-operators/vector-functions.md#esql-knn)

Check notice on line 1 in docs/reference/query-languages/esql/_snippets/lists/vector-functions.md

View workflow job for this annotation

GitHub Actions / docs-preview / build

The 'development' lifecycle is deprecated and will be removed in a future release.

Check notice on line 1 in docs/reference/query-languages/esql/_snippets/lists/vector-functions.md

View workflow job for this annotation

GitHub Actions / docs-preview / build

The 'development' lifecycle is deprecated and will be removed in a future release.

Check notice on line 1 in docs/reference/query-languages/esql/_snippets/lists/vector-functions.md

View workflow job for this annotation

GitHub Actions / docs-preview / build

The 'development' lifecycle is deprecated and will be removed in a future release.

Check notice on line 1 in docs/reference/query-languages/esql/_snippets/lists/vector-functions.md

View workflow job for this annotation

GitHub Actions / docs-preview / build

The 'development' lifecycle is deprecated and will be removed in a future release.

Check notice on line 1 in docs/reference/query-languages/esql/_snippets/lists/vector-functions.md

View workflow job for this annotation

GitHub Actions / docs-preview / build

The 'development' lifecycle is deprecated and will be removed in a future release.

Check notice on line 1 in docs/reference/query-languages/esql/_snippets/lists/vector-functions.md

View workflow job for this annotation

GitHub Actions / docs-preview / build

The 'development' lifecycle is deprecated and will be removed in a future release.

Check notice on line 1 in docs/reference/query-languages/esql/_snippets/lists/vector-functions.md

View workflow job for this annotation

GitHub Actions / docs-preview / build

The 'development' lifecycle is deprecated and will be removed in a future release.

Check notice on line 1 in docs/reference/query-languages/esql/_snippets/lists/vector-functions.md

View workflow job for this annotation

GitHub Actions / docs-preview / build

The 'development' lifecycle is deprecated and will be removed in a future release.

Check notice on line 1 in docs/reference/query-languages/esql/_snippets/lists/vector-functions.md

View workflow job for this annotation

GitHub Actions / docs-preview / build

The 'development' lifecycle is deprecated and will be removed in a future release.

Check notice on line 1 in docs/reference/query-languages/esql/_snippets/lists/vector-functions.md

View workflow job for this annotation

GitHub Actions / docs-preview / build

The 'development' lifecycle is deprecated and will be removed in a future release.
% * {applies_to}`stack: development` {applies_to}`serverless: preview` [`V_COSINE`](../../functions-operators/vector-functions.md#esql-v_cosine)
% * {applies_to}`stack: development` {applies_to}`serverless: preview` [`V_DOT_PRODUCT`](../../functions-operators/vector-functions.md#esql-v_dot_product)
% * {applies_to}`stack: preview` {applies_to}`serverless: preview` [`V_HAMMING`](../../functions-operators/vector-functions.md#esql-v_hamming)
% * {applies_to}`stack: development` {applies_to}`serverless: preview` [`V_L1_NORM`](../../functions-operators/vector-functions.md#esql-v_l1_norm)
% * {applies_to}`stack: development` {applies_to}`serverless: preview` [`V_L2_NORM`](../../functions-operators/vector-functions.md#esql-v_l2_norm)
% * {applies_to}`stack: development` {applies_to}`serverless: preview` [`V_MAGNITUDE`](../../functions-operators/vector-functions.md#esql-v_magnitude)
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,12 @@ mapped_pages:
:::
::::

::::{dropdown} Vector functions
:open:
:::{include} _snippets/lists/vector-functions.md
:::
::::

::::{dropdown} Multi value functions
:open:
:::{include} _snippets/lists/mv-functions.md
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ for information on the limitations of full text search.
:::{include} ../_snippets/functions/layout/kql.md
:::

:::{include} ../_snippets/functions/layout/knn.md
:::

:::{include} ../_snippets/functions/layout/match.md
:::

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
---
applies_to:
stack: preview
serverless: preview
navigation_title: "Vector functions"
mapped_pages:
- https://www.elastic.co/guide/en/elasticsearch/reference/current/esql-functions-operators.html#esql-vector-functions
---

# {{esql}} vector functions [esql-vector-functions]

{{esql}} supports vector functions for dense vector similarity calculations and k-nearest neighbor search.

:::{note}
Vector functions are currently in **preview** and may change in future versions.
They work with `dense_vector` fields and require appropriate field mappings.
:::

{{esql}} supports these vector functions:

:::{include} ../_snippets/lists/vector-functions.md
:::

:::{include} ../_snippets/functions/layout/knn.md
:::

% V_COSINE is currently a hidden feature
% To make it visible again, uncomment this and the line in
% lists/vector-functions.md
% :::{include} ../_snippets/functions/layout/v_cosine.md
% :::

% V_DOT_PRODUCT is currently a hidden feature
% To make it visible again, uncomment this and the line in
% lists/vector-functions.md
% :::{include} ../_snippets/functions/layout/v_dot_product.md
% :::

% V_HAMMING is currently a hidden feature
% To make it visible again, uncomment this and the line in
% lists/vector-functions.md
% :::{include} ../_snippets/functions/layout/v_hamming.md
% :::

% V_L1_NORM is currently a hidden feature
% To make it visible again, uncomment this and the line in
% lists/vector-functions.md
% :::{include} ../_snippets/functions/layout/v_l1_norm.md
% :::

% V_L2_NORM is currently a hidden feature
% To make it visible again, uncomment this and the line in
% lists/vector-functions.md
% :::{include} ../_snippets/functions/layout/v_l2_norm.md
% :::

% V_MAGNITUDE is currently a hidden feature
% To make it visible again, uncomment this and the line in
% lists/vector-functions.md
% :::{include} ../_snippets/functions/layout/v_magnitude.md
% :::

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions docs/reference/query-languages/toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ toc:
- file: esql/functions-operators/search-functions.md
- file: esql/functions-operators/spatial-functions.md
- file: esql/functions-operators/string-functions.md
- file: esql/functions-operators/vector-functions.md
- file: esql/functions-operators/type-conversion-functions.md
- file: esql/functions-operators/mv-functions.md
- file: esql/functions-operators/operators.md
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ public Knn(
+ "(docs-content://solutions/search/vector/knn.md#dense-vector-knn-search-rescoring) for details."
), },
description = "(Optional) kNN additional options as <<esql-function-named-params,function named parameters>>."
+ " See <<query-dsl-knn-query,knn query>> for more information.",
+ " See [knn query](/reference/query-languages/query-dsl/query-dsl-knn-query.md) for more information.",
optional = true
) Expression options
) {
Expand Down