Skip to content

Commit fc12bf1

Browse files
committed
Enabling RERANK in non-snapshot build.
1 parent 1bb9d2b commit fc12bf1

File tree

17 files changed

+2294
-2350
lines changed

17 files changed

+2294
-2350
lines changed

x-pack/plugin/esql/qa/server/src/main/java/org/elasticsearch/xpack/esql/qa/rest/RestRerankTestCase.java

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
import org.elasticsearch.client.ResponseException;
1212
import org.elasticsearch.test.rest.ESRestTestCase;
1313
import org.elasticsearch.xpack.esql.AssertWarnings;
14-
import org.elasticsearch.xpack.esql.action.EsqlCapabilities;
1514
import org.junit.After;
1615
import org.junit.Before;
1716
import org.junit.Rule;
@@ -29,14 +28,6 @@ public class RestRerankTestCase extends ESRestTestCase {
2928
@Rule(order = Integer.MIN_VALUE)
3029
public ProfileLogger profileLogger = new ProfileLogger();
3130

32-
@Before
33-
public void skipWhenRerankDisabled() throws IOException {
34-
assumeTrue(
35-
"Requires RERANK capability",
36-
RestEsqlTestCase.hasCapabilities(adminClient(), List.of(EsqlCapabilities.Cap.RERANK.capabilityName()))
37-
);
38-
}
39-
4031
@Before
4132
@After
4233
public void assertRequestBreakerEmpty() throws Exception {

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

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

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,11 @@ processingCommand
5959
| completionCommand
6060
| sampleCommand
6161
| forkCommand
62+
| rerankCommand
6263
// in development
6364
| {this.isDevVersion()}? inlinestatsCommand
6465
| {this.isDevVersion()}? lookupCommand
6566
| {this.isDevVersion()}? insistCommand
66-
| {this.isDevVersion()}? rerankCommand
6767
| {this.isDevVersion()}? fuseCommand
6868
;
6969

@@ -297,6 +297,10 @@ forkSubQueryProcessingCommand
297297
: processingCommand
298298
;
299299

300+
rerankCommand
301+
: RERANK (targetField=qualifiedName ASSIGN)? queryText=constant ON rerankFields commandNamedParameters
302+
;
303+
300304
completionCommand
301305
: COMPLETION (targetField=qualifiedName ASSIGN)? prompt=primaryExpression commandNamedParameters
302306
;
@@ -319,7 +323,3 @@ insistCommand
319323
fuseCommand
320324
: DEV_FUSE
321325
;
322-
323-
rerankCommand
324-
: DEV_RERANK (targetField=qualifiedName ASSIGN)? queryText=constant ON rerankFields commandNamedParameters
325-
;

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

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

x-pack/plugin/esql/src/main/antlr/lexer/Expression.g4

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@ DISSECT : 'dissect' -> pushMode(EXPRESSION_MODE);
1414
EVAL : 'eval' -> pushMode(EXPRESSION_MODE);
1515
GROK : 'grok' -> pushMode(EXPRESSION_MODE);
1616
LIMIT : 'limit' -> pushMode(EXPRESSION_MODE);
17+
RERANK : 'rerank' -> pushMode(EXPRESSION_MODE);
1718
ROW : 'row' -> pushMode(EXPRESSION_MODE);
1819
SAMPLE : 'sample' -> pushMode(EXPRESSION_MODE);
1920
SORT : 'sort' -> pushMode(EXPRESSION_MODE);
2021
STATS : 'stats' -> pushMode(EXPRESSION_MODE);
2122
WHERE : 'where' -> pushMode(EXPRESSION_MODE);
2223

2324
DEV_INLINESTATS : {this.isDevVersion()}? 'inlinestats' -> pushMode(EXPRESSION_MODE);
24-
DEV_RERANK : {this.isDevVersion()}? 'rerank' -> pushMode(EXPRESSION_MODE);
2525

2626

2727
mode EXPRESSION_MODE;

x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/action/EsqlCapabilities.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -962,7 +962,7 @@ public enum Cap {
962962
/**
963963
* Support for RERANK command
964964
*/
965-
RERANK(Build.current().isSnapshot()),
965+
RERANK,
966966

967967
/**
968968
* Support for COMPLETION command

x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/parser/EsqlBaseLexer.interp

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

0 commit comments

Comments
 (0)