Skip to content

Commit 17d463f

Browse files
authored
Register match_phrase as a function not a snapshot function (#129255)
* Register match_phrase as a function not a snapshot function * Update usage
1 parent 7b8f4fb commit 17d463f

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

docs/reference/query-languages/esql/kibana/definition/functions/match_phrase.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/EsqlFunctionRegistry.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -466,7 +466,8 @@ private static FunctionDefinition[][] functions() {
466466
def(Kql.class, uni(Kql::new), "kql"),
467467
def(Match.class, tri(Match::new), "match"),
468468
def(MultiMatch.class, MultiMatch::new, "multi_match"),
469-
def(QueryString.class, bi(QueryString::new), "qstr") } };
469+
def(QueryString.class, bi(QueryString::new), "qstr"),
470+
def(MatchPhrase.class, tri(MatchPhrase::new), "match_phrase") } };
470471

471472
}
472473

@@ -486,7 +487,6 @@ private static FunctionDefinition[][] snapshotFunctions() {
486487
def(LastOverTime.class, LastOverTime::withUnresolvedTimestamp, "last_over_time"),
487488
def(FirstOverTime.class, FirstOverTime::withUnresolvedTimestamp, "first_over_time"),
488489
def(Term.class, bi(Term::new), "term"),
489-
def(MatchPhrase.class, tri(MatchPhrase::new), "match_phrase"),
490490
def(Knn.class, tri(Knn::new), "knn") } };
491491
}
492492

x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/esql/60_usage.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ setup:
130130
- match: {esql.functions.coalesce: $functions_coalesce}
131131
- gt: {esql.functions.categorize: $functions_categorize}
132132
# Testing for the entire function set isn't feasible, so we just check that we return the correct count as an approximation.
133-
- length: {esql.functions: 157} # check the "sister" test below for a likely update to the same esql.functions length check
133+
- length: {esql.functions: 156} # check the "sister" test below for a likely update to the same esql.functions length check
134134

135135
---
136136
"Basic ESQL usage output (telemetry) non-snapshot version":
@@ -228,7 +228,7 @@ setup:
228228
- gt: {esql.functions.to_long: $functions_to_long}
229229
- match: {esql.functions.coalesce: $functions_coalesce}
230230
- gt: {esql.functions.categorize: $functions_categorize}
231-
- length: {esql.functions: 145} # check the "sister" test above for a likely update to the same esql.functions length check
231+
- length: {esql.functions: 146} # check the "sister" test above for a likely update to the same esql.functions length check
232232

233233
---
234234
took:

0 commit comments

Comments
 (0)