Register match_phrase as a function not a snapshot function (#129255)

* Register match_phrase as a function not a snapshot function

* Update usage
This commit is contained in:
Kathleen DeRusso 2025-06-11 13:01:24 -04:00 committed by GitHub
parent 7b8f4fb441
commit 17d463f6bf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 5 additions and 5 deletions

View file

@ -59,5 +59,5 @@
"FROM books\n| WHERE MATCH_PHRASE(author, \"William Faulkner\")"
],
"preview" : true,
"snapshot_only" : true
"snapshot_only" : false
}

View file

@ -466,7 +466,8 @@ public class EsqlFunctionRegistry {
def(Kql.class, uni(Kql::new), "kql"),
def(Match.class, tri(Match::new), "match"),
def(MultiMatch.class, MultiMatch::new, "multi_match"),
def(QueryString.class, bi(QueryString::new), "qstr") } };
def(QueryString.class, bi(QueryString::new), "qstr"),
def(MatchPhrase.class, tri(MatchPhrase::new), "match_phrase") } };
}
@ -486,7 +487,6 @@ public class EsqlFunctionRegistry {
def(LastOverTime.class, LastOverTime::withUnresolvedTimestamp, "last_over_time"),
def(FirstOverTime.class, FirstOverTime::withUnresolvedTimestamp, "first_over_time"),
def(Term.class, bi(Term::new), "term"),
def(MatchPhrase.class, tri(MatchPhrase::new), "match_phrase"),
def(Knn.class, tri(Knn::new), "knn") } };
}

View file

@ -130,7 +130,7 @@ setup:
- match: {esql.functions.coalesce: $functions_coalesce}
- gt: {esql.functions.categorize: $functions_categorize}
# Testing for the entire function set isn't feasible, so we just check that we return the correct count as an approximation.
- length: {esql.functions: 157} # check the "sister" test below for a likely update to the same esql.functions length check
- length: {esql.functions: 156} # check the "sister" test below for a likely update to the same esql.functions length check
---
"Basic ESQL usage output (telemetry) non-snapshot version":
@ -228,7 +228,7 @@ setup:
- gt: {esql.functions.to_long: $functions_to_long}
- match: {esql.functions.coalesce: $functions_coalesce}
- gt: {esql.functions.categorize: $functions_categorize}
- length: {esql.functions: 145} # check the "sister" test above for a likely update to the same esql.functions length check
- length: {esql.functions: 146} # check the "sister" test above for a likely update to the same esql.functions length check
---
took: