Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -805,7 +805,7 @@ public void testNamedParamsForIdentifierAndIdentifierPatterns() throws IOExcepti
error = re.getMessage();
assertThat(error, containsString("ParsingException"));
assertThat(error, containsString("line 1:23: mismatched input '?cmd' expecting {"));
assertThat(error, containsString("'dissect', 'eval', 'grok', 'limit', 'sample', 'sort'"));
assertThat(error, containsString("'dissect', 'eval', 'grok', 'limit', 'rerank', 'sample', 'sort'"));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
import org.elasticsearch.client.ResponseException;
import org.elasticsearch.test.rest.ESRestTestCase;
import org.elasticsearch.xpack.esql.AssertWarnings;
import org.elasticsearch.xpack.esql.action.EsqlCapabilities;
import org.junit.After;
import org.junit.Before;
import org.junit.Rule;
Expand All @@ -29,14 +28,6 @@ public class RestRerankTestCase extends ESRestTestCase {
@Rule(order = Integer.MIN_VALUE)
public ProfileLogger profileLogger = new ProfileLogger();

@Before
public void skipWhenRerankDisabled() throws IOException {
assumeTrue(
"Requires RERANK capability",
RestEsqlTestCase.hasCapabilities(adminClient(), List.of(EsqlCapabilities.Cap.RERANK.capabilityName()))
);
}

@Before
@After
public void assertRequestBreakerEmpty() throws Exception {
Expand Down
25 changes: 13 additions & 12 deletions x-pack/plugin/esql/src/main/antlr/EsqlBaseLexer.tokens

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions x-pack/plugin/esql/src/main/antlr/EsqlBaseParser.g4
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,11 @@ processingCommand
| completionCommand
| sampleCommand
| forkCommand
| rerankCommand
// in development
| {this.isDevVersion()}? inlinestatsCommand
| {this.isDevVersion()}? lookupCommand
| {this.isDevVersion()}? insistCommand
| {this.isDevVersion()}? rerankCommand
| {this.isDevVersion()}? fuseCommand
;

Expand Down Expand Up @@ -297,6 +297,10 @@ forkSubQueryProcessingCommand
: processingCommand
;

rerankCommand
: RERANK (targetField=qualifiedName ASSIGN)? queryText=constant ON rerankFields commandNamedParameters
;

completionCommand
: COMPLETION (targetField=qualifiedName ASSIGN)? prompt=primaryExpression commandNamedParameters
;
Expand All @@ -319,7 +323,3 @@ insistCommand
fuseCommand
: DEV_FUSE
;

rerankCommand
: DEV_RERANK (targetField=qualifiedName ASSIGN)? queryText=constant ON rerankFields commandNamedParameters
;
25 changes: 13 additions & 12 deletions x-pack/plugin/esql/src/main/antlr/EsqlBaseParser.tokens

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion x-pack/plugin/esql/src/main/antlr/lexer/Expression.g4
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ DISSECT : 'dissect' -> pushMode(EXPRESSION_MODE);
EVAL : 'eval' -> pushMode(EXPRESSION_MODE);
GROK : 'grok' -> pushMode(EXPRESSION_MODE);
LIMIT : 'limit' -> pushMode(EXPRESSION_MODE);
RERANK : 'rerank' -> pushMode(EXPRESSION_MODE);
ROW : 'row' -> pushMode(EXPRESSION_MODE);
SAMPLE : 'sample' -> pushMode(EXPRESSION_MODE);
SORT : 'sort' -> pushMode(EXPRESSION_MODE);
STATS : 'stats' -> pushMode(EXPRESSION_MODE);
WHERE : 'where' -> pushMode(EXPRESSION_MODE);

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


mode EXPRESSION_MODE;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -962,7 +962,7 @@ public enum Cap {
/**
* Support for RERANK command
*/
RERANK(Build.current().isSnapshot()),
RERANK,

/**
* Support for COMPLETION command
Expand Down

Large diffs are not rendered by default.

Loading