From dceeca2696aa192f0d4d413eef7499f9772961d2 Mon Sep 17 00:00:00 2001 From: Tommaso Teofili Date: Wed, 20 Aug 2025 13:00:43 +0200 Subject: [PATCH 1/5] ES|QL move score function out of snapshot --- .../org/elasticsearch/xpack/esql/action/EsqlCapabilities.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/action/EsqlCapabilities.java b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/action/EsqlCapabilities.java index cdef9f8c33cbd..5148b6e294787 100644 --- a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/action/EsqlCapabilities.java +++ b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/action/EsqlCapabilities.java @@ -1126,7 +1126,7 @@ public enum Cap { /** * score function */ - SCORE_FUNCTION(Build.current().isSnapshot()), + SCORE_FUNCTION, /** * Support for the SAMPLE command From ac92d7a1522fc231a4731b7107323243a5fa8441 Mon Sep 17 00:00:00 2001 From: Tommaso Teofili Date: Wed, 20 Aug 2025 13:10:31 +0200 Subject: [PATCH 2/5] ES|QL move score function out of snapshot --- .../esql/_snippets/lists/search-functions.md | 1 + .../esql/functions-operators/search-functions.md | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/docs/reference/query-languages/esql/_snippets/lists/search-functions.md b/docs/reference/query-languages/esql/_snippets/lists/search-functions.md index 76b0929065a13..188599b8edb0f 100644 --- a/docs/reference/query-languages/esql/_snippets/lists/search-functions.md +++ b/docs/reference/query-languages/esql/_snippets/lists/search-functions.md @@ -2,4 +2,5 @@ * [`MATCH`](../../functions-operators/search-functions.md#esql-match) * [`MATCH_PHRASE`](../../functions-operators/search-functions.md#esql-match_phrase) * [`QSTR`](../../functions-operators/search-functions.md#esql-qstr) +* [`SCORE`](../../functions-operators/search-functions.md#esql-score) % * [preview] [`TERM`](../../functions-operators/search-functions.md#esql-term) diff --git a/docs/reference/query-languages/esql/functions-operators/search-functions.md b/docs/reference/query-languages/esql/functions-operators/search-functions.md index bf31cce7df3ca..64a701b4252a6 100644 --- a/docs/reference/query-languages/esql/functions-operators/search-functions.md +++ b/docs/reference/query-languages/esql/functions-operators/search-functions.md @@ -13,7 +13,7 @@ our [hands-on tutorial](docs-content://solutions/search/esql-search-tutorial.md) For a high-level overview of search functionalities in {{esql}}, and to learn about relevance scoring, refer to [{{esql}} for search](docs-content://solutions/search/esql-for-search.md#esql-for-search-scoring). ::: -{{esql}} provides a set of functions for performing searching on text fields. +{{esql}} provides a set of functions for performing searching on text fields. Use these functions for [full-text search](docs-content://solutions/search/full-text.md) @@ -48,6 +48,10 @@ for information on the limitations of full text search. :::{include} ../_snippets/functions/layout/qstr.md ::: +:::{include} ../_snippets/functions/layout/score.md +::: + + % TERM is currently a hidden feature % To make it visible again, uncomment this and the line in lists/search-functions.md From 8054fe127509829425ae0da258f95f971c0137a8 Mon Sep 17 00:00:00 2001 From: Tommaso Teofili Date: Thu, 21 Aug 2025 13:21:25 +0200 Subject: [PATCH 3/5] add preview tag --- .../query-languages/esql/_snippets/lists/search-functions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/reference/query-languages/esql/_snippets/lists/search-functions.md b/docs/reference/query-languages/esql/_snippets/lists/search-functions.md index 188599b8edb0f..57d72cb17d265 100644 --- a/docs/reference/query-languages/esql/_snippets/lists/search-functions.md +++ b/docs/reference/query-languages/esql/_snippets/lists/search-functions.md @@ -2,5 +2,5 @@ * [`MATCH`](../../functions-operators/search-functions.md#esql-match) * [`MATCH_PHRASE`](../../functions-operators/search-functions.md#esql-match_phrase) * [`QSTR`](../../functions-operators/search-functions.md#esql-qstr) -* [`SCORE`](../../functions-operators/search-functions.md#esql-score) +* [preview] [`SCORE`](../../functions-operators/search-functions.md#esql-score) % * [preview] [`TERM`](../../functions-operators/search-functions.md#esql-term) From 0eef0641a0664467ef39d35fef45688aad53cb6f Mon Sep 17 00:00:00 2001 From: Tommaso Teofili Date: Fri, 22 Aug 2025 17:29:47 +0200 Subject: [PATCH 4/5] function moved out of snapshot functions, doc update --- .../esql/kibana/definition/functions/score.json | 2 +- .../xpack/esql/expression/function/EsqlFunctionRegistry.java | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/docs/reference/query-languages/esql/kibana/definition/functions/score.json b/docs/reference/query-languages/esql/kibana/definition/functions/score.json index 4772093e349d9..ace99710c5fde 100644 --- a/docs/reference/query-languages/esql/kibana/definition/functions/score.json +++ b/docs/reference/query-languages/esql/kibana/definition/functions/score.json @@ -21,5 +21,5 @@ "FROM books METADATA _score\n| WHERE match(title, \"Return\") AND match(author, \"Tolkien\")\n| EVAL first_score = score(match(title, \"Return\"))" ], "preview" : true, - "snapshot_only" : true + "snapshot_only" : false } diff --git a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/EsqlFunctionRegistry.java b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/EsqlFunctionRegistry.java index 9d6372702d842..23d4ef32b5621 100644 --- a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/EsqlFunctionRegistry.java +++ b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/EsqlFunctionRegistry.java @@ -471,7 +471,9 @@ private static FunctionDefinition[][] functions() { def(Match.class, tri(Match::new), "match"), def(MultiMatch.class, MultiMatch::new, "multi_match"), def(QueryString.class, bi(QueryString::new), "qstr"), - def(MatchPhrase.class, tri(MatchPhrase::new), "match_phrase") } }; + def(MatchPhrase.class, tri(MatchPhrase::new), "match_phrase"), + def(Score.class, uni(Score::new), "score"), + } }; } @@ -492,7 +494,6 @@ private static FunctionDefinition[][] snapshotFunctions() { def(AvgOverTime.class, uni(AvgOverTime::new), "avg_over_time"), def(LastOverTime.class, uni(LastOverTime::new), "last_over_time"), def(FirstOverTime.class, uni(FirstOverTime::new), "first_over_time"), - def(Score.class, uni(Score::new), Score.NAME), def(Term.class, bi(Term::new), "term"), def(Knn.class, quad(Knn::new), "knn"), def(StGeohash.class, StGeohash::new, "st_geohash"), From 3680ee4ec9deb54c77e0e9bfc48d42cdf3e80c3e Mon Sep 17 00:00:00 2001 From: elasticsearchmachine Date: Fri, 22 Aug 2025 15:38:41 +0000 Subject: [PATCH 5/5] [CI] Auto commit changes from spotless --- .../xpack/esql/expression/function/EsqlFunctionRegistry.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/EsqlFunctionRegistry.java b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/EsqlFunctionRegistry.java index 23d4ef32b5621..fd9f85a4ea9be 100644 --- a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/EsqlFunctionRegistry.java +++ b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/EsqlFunctionRegistry.java @@ -472,8 +472,7 @@ private static FunctionDefinition[][] functions() { def(MultiMatch.class, MultiMatch::new, "multi_match"), def(QueryString.class, bi(QueryString::new), "qstr"), def(MatchPhrase.class, tri(MatchPhrase::new), "match_phrase"), - def(Score.class, uni(Score::new), "score"), - } }; + def(Score.class, uni(Score::new), "score"), } }; }