From 68907ff92de181ffe91c853fe33ebe7c309566b4 Mon Sep 17 00:00:00 2001 From: carlosdelest Date: Tue, 19 Nov 2024 18:21:02 +0100 Subject: [PATCH] Add missing type "text" for the operator --- .../kibana/definition/match_operator.json | 18 ++++++++++++++++++ .../functions/types/match_operator.asciidoc | 1 + .../function/fulltext/MatchOperatorTests.java | 1 + 3 files changed, 20 insertions(+) diff --git a/docs/reference/esql/functions/kibana/definition/match_operator.json b/docs/reference/esql/functions/kibana/definition/match_operator.json index 3fcf1726e5538..2facebfc44e57 100644 --- a/docs/reference/esql/functions/kibana/definition/match_operator.json +++ b/docs/reference/esql/functions/kibana/definition/match_operator.json @@ -21,6 +21,24 @@ ], "variadic" : false, "returnType" : "boolean" + }, + { + "params" : [ + { + "name" : "field", + "type" : "text", + "optional" : false, + "description" : "Field that the query will target." + }, + { + "name" : "query", + "type" : "text", + "optional" : false, + "description" : "Text you wish to find in the provided field." + } + ], + "variadic" : false, + "returnType" : "boolean" } ], "examples" : [ diff --git a/docs/reference/esql/functions/types/match_operator.asciidoc b/docs/reference/esql/functions/types/match_operator.asciidoc index 1d2eb92a189f7..5c6afacdce1b2 100644 --- a/docs/reference/esql/functions/types/match_operator.asciidoc +++ b/docs/reference/esql/functions/types/match_operator.asciidoc @@ -6,4 +6,5 @@ |=== field | query | result keyword | keyword | boolean +text | text | boolean |=== diff --git a/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/fulltext/MatchOperatorTests.java b/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/fulltext/MatchOperatorTests.java index 23e428d995547..180f6c87f8dc0 100644 --- a/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/fulltext/MatchOperatorTests.java +++ b/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/fulltext/MatchOperatorTests.java @@ -33,6 +33,7 @@ public static Iterable parameters() { // Have a minimal test so that we can generate the docs List suppliers = new LinkedList<>(); addPositiveTestCase(List.of(DataType.KEYWORD, DataType.KEYWORD), suppliers); + addPositiveTestCase(List.of(DataType.TEXT, DataType.TEXT), suppliers); return parameterSuppliersFromTypedData(suppliers); } }