Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
5 changes: 5 additions & 0 deletions docs/changelog/139272.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
pr: 139272
summary: Take TOP_SNIPPETS out of snapshot
Copy link
Member

Choose a reason for hiding this comment

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

Nit - Let's add something more release notes friendly:

Suggested change
summary: Take TOP_SNIPPETS out of snapshot
summary: ES|QL - Add TOP_SNIPPETS as tech preview

area: ES|QL
type: enhancement
issues: []
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
* [`SPLIT`](../../functions-operators/string-functions.md#esql-split)
* [`STARTS_WITH`](../../functions-operators/string-functions.md#esql-starts_with)
* [`SUBSTRING`](../../functions-operators/string-functions.md#esql-substring)
* [`TOP_SNIPPETS`](../../functions-operators/string-functions.md#esql-top_snippets)
* [`TO_BASE64`](../../functions-operators/string-functions.md#esql-to_base64)
* [`TO_LOWER`](../../functions-operators/string-functions.md#esql-to_lower)
* [`TO_UPPER`](../../functions-operators/string-functions.md#esql-to_upper)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,9 @@ mapped_pages:
:::{include} ../_snippets/functions/layout/substring.md
:::

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

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

Expand Down

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
Expand Up @@ -1732,7 +1732,7 @@ public enum Cap {
/**
* Returns the top snippets for given text content and associated query.
*/
TOP_SNIPPETS_FUNCTION(Build.current().isSnapshot()),
TOP_SNIPPETS_FUNCTION,

// Last capability should still have a comma for fewer merge conflicts when adding new ones :)
// This comment prevents the semicolon from being on the previous capability when Spotless formats the file.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,8 @@ private static FunctionDefinition[][] functions() {
def(UrlEncode.class, UrlEncode::new, "url_encode"),
def(UrlEncodeComponent.class, UrlEncodeComponent::new, "url_encode_component"),
def(UrlDecode.class, UrlDecode::new, "url_decode"),
def(Chunk.class, bi(Chunk::new), "chunk") },
def(Chunk.class, bi(Chunk::new), "chunk"),
def(TopSnippets.class, tri(TopSnippets::new), "top_snippets") },
// date
new FunctionDefinition[] {
def(DateDiff.class, tric(DateDiff::new), "date_diff"),
Expand Down Expand Up @@ -574,8 +575,7 @@ private static FunctionDefinition[][] snapshotFunctions() {
def(L1Norm.class, L1Norm::new, "v_l1_norm"),
def(L2Norm.class, L2Norm::new, "v_l2_norm"),
def(Magnitude.class, Magnitude::new, "v_magnitude"),
def(Hamming.class, Hamming::new, "v_hamming"),
def(TopSnippets.class, tri(TopSnippets::new), "top_snippets") } };
def(Hamming.class, Hamming::new, "v_hamming") } };
}

public EsqlFunctionRegistry snapshotRegistry() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3335,8 +3335,6 @@ public void testChunkFunctionInvalidInputs() {
}

public void testTopSnippetsFunctionInvalidInputs() {
assumeTrue("Requires top snippet function", EsqlCapabilities.Cap.TOP_SNIPPETS_FUNCTION.isEnabled());

// Null field allowed
query("from test | EVAL snippets = TOP_SNIPPETS(null, \"query\")");

Expand Down
Loading