Skip to content

Commit 0304b92

Browse files
authored
ESQL - match operator included in non-snapshot builds (elastic#116819) (elastic#117227)
(cherry picked from commit ea4b41f)
1 parent cafa440 commit 0304b92

File tree

25 files changed

+1963
-1837
lines changed

25 files changed

+1963
-1837
lines changed

docs/changelog/116819.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 116819
2+
summary: ESQL - Add match operator (:)
3+
area: Search
4+
type: feature
5+
issues: []

docs/reference/esql/functions/kibana/definition/match_operator.json

Lines changed: 49 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/reference/esql/functions/kibana/docs/match_operator.md

Lines changed: 14 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/reference/esql/functions/operators.asciidoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ Boolean operators for comparing against one or multiple expressions.
1616
* <<esql-in-operator>>
1717
* <<esql-like-operator>>
1818
* <<esql-rlike-operator>>
19+
* experimental:[] <<esql-search-operators>>
1920
// end::op_list[]
2021

2122
include::binary.asciidoc[]
@@ -26,3 +27,4 @@ include::cast.asciidoc[]
2627
include::in.asciidoc[]
2728
include::like.asciidoc[]
2829
include::rlike.asciidoc[]
30+
include::search.asciidoc[]
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
[discrete]
2+
[[esql-search-operators]]
3+
=== Search operators
4+
5+
The only search operator is match (`:`).
6+
7+
preview::["Do not use on production environments. This functionality is in technical preview and may be changed or removed in a future release. Elastic will work to fix any issues, but features in technical preview are not subject to the support SLA of official GA features."]
8+
9+
The match operator performs a <<query-dsl-match-query,match query>> on the specified field. Returns true if the provided query matches the row.
10+
11+
[.text-center]
12+
image::esql/functions/signature/match_operator.svg[Embedded,opts=inline]
13+
14+
include::types/match.asciidoc[]
15+
16+
[source.merge.styled,esql]
17+
----
18+
include::{esql-specs}/match-operator.csv-spec[tag=match-with-field]
19+
----
20+
[%header.monospaced.styled,format=dsv,separator=|]
21+
|===
22+
include::{esql-specs}/match-operator.csv-spec[tag=match-with-field-result]
23+
|===

docs/reference/esql/functions/signature/match_operator.svg

Lines changed: 1 addition & 0 deletions
Loading

docs/reference/esql/functions/types/match_operator.asciidoc

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

x-pack/plugin/esql/src/internalClusterTest/java/org/elasticsearch/xpack/esql/plugin/MatchOperatorIT.java

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@
1414
import org.elasticsearch.test.junit.annotations.TestLogging;
1515
import org.elasticsearch.xpack.esql.VerificationException;
1616
import org.elasticsearch.xpack.esql.action.AbstractEsqlIntegTestCase;
17-
import org.elasticsearch.xpack.esql.action.EsqlCapabilities;
18-
import org.elasticsearch.xpack.esql.action.EsqlQueryRequest;
19-
import org.elasticsearch.xpack.esql.action.EsqlQueryResponse;
2017
import org.junit.Before;
2118

2219
import java.util.List;
@@ -32,12 +29,6 @@ public void setupIndex() {
3229
createAndPopulateIndex();
3330
}
3431

35-
@Override
36-
protected EsqlQueryResponse run(EsqlQueryRequest request) {
37-
assumeTrue("match operator capability not available", EsqlCapabilities.Cap.MATCH_OPERATOR_COLON.isEnabled());
38-
return super.run(request);
39-
}
40-
4132
public void testSimpleWhereMatch() {
4233
var query = """
4334
FROM test

x-pack/plugin/esql/src/main/antlr/EsqlBaseLexer.g4

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,6 @@ WS
112112
: [ \r\n\t]+ -> channel(HIDDEN)
113113
;
114114

115-
COLON : ':';
116-
117115
//
118116
// Expression - used by most command
119117
//
@@ -184,6 +182,7 @@ AND : 'and';
184182
ASC : 'asc';
185183
ASSIGN : '=';
186184
CAST_OP : '::';
185+
COLON : ':';
187186
COMMA : ',';
188187
DESC : 'desc';
189188
DOT : '.';
@@ -216,7 +215,6 @@ MINUS : '-';
216215
ASTERISK : '*';
217216
SLASH : '/';
218217
PERCENT : '%';
219-
EXPRESSION_COLON : {this.isDevVersion()}? COLON -> type(COLON);
220218

221219
NESTED_WHERE : WHERE -> type(WHERE);
222220

x-pack/plugin/esql/src/main/antlr/EsqlBaseLexer.tokens

Lines changed: 17 additions & 17 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)