Skip to content
Merged
Show file tree
Hide file tree
Changes from 29 commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
e5552ce
Adding ES|QL RERANK command in snapshot builds (#123074)
afoucret Apr 4, 2025
ac63795
[ES|QL] COMPLETION command grammar and logical plan (#126319)
afoucret Apr 11, 2025
708180e
Skip rerank tests in mixed clusters (#126415)
dnhatn Apr 7, 2025
3bced47
Fix reranker tests (#126500)
afoucret Apr 9, 2025
d5a78ba
[ES|QL] Rerank command: unmute reranker tests in multi-node. (#126521)
afoucret Apr 9, 2025
40e83cb
[ES|QL] COMPLETION command analysis. (#126677)
afoucret Apr 11, 2025
d98b76a
[ES|QL] COMPLETION command logical plan optimizer (#126763)
afoucret Apr 16, 2025
350ea7b
[ES|QL] COMPLETION command physical plan (#126766)
afoucret Apr 15, 2025
bfb3718
ESQL - Enable telemetry for COMPLETION command (#127731)
svilen-mihaylov-elastic May 22, 2025
e8bea9a
Prevent concurrent access to local breaker in rerank (#128162)
dnhatn May 22, 2025
999ffac
[ES|QL] Enable telemetry for the rerank command (#128679)
afoucret May 30, 2025
e01703d
[ES|QL] Prevent using unnamed fields in the RERANK command (#127416)
svilen-mihaylov-elastic Apr 30, 2025
e1b241e
[ES|QL] RERANK command default inferenceId (#128685)
afoucret May 30, 2025
c57f899
Remove duplicated change.
afoucret Jun 4, 2025
1842c90
Lint changes
afoucret Jun 4, 2025
2d4fc26
Regenerate the parser
afoucret Jun 4, 2025
f97680a
Add RERANK and COMPLETION to telemetry features.
afoucret Jun 4, 2025
29a41cc
[ES|QL] COMPLETION command - Inference Operator implementation (#127409)
afoucret Jun 5, 2025
a829849
Merge branch '8.19' of https://github.com/elastic/elasticsearch into …
afoucret Jun 5, 2025
8a071f8
Merge branch '8.19' of https://github.com/elastic/elasticsearch into …
afoucret Jun 6, 2025
42478ac
[CI] Auto commit changes from spotless
Jun 6, 2025
6fbc6b7
Fix error during merge.
afoucret Jun 6, 2025
3590a3c
Fix error added during merge.
afoucret Jun 6, 2025
b761e53
[ES|QL] Enable the completion command as a tech preview feature (#128…
afoucret Jun 6, 2025
173ffe1
Adding RERANK and COMPLETION to the YAML REST ES|QL usage tests.
afoucret Jun 6, 2025
e81d85b
Update InferenceGetServicesIT with the new completion test service.
afoucret Jun 6, 2025
b1b4888
Update usage API example so the test docs can pass
afoucret Jun 6, 2025
5a9acee
Fix typo
afoucret Jun 6, 2025
db78e9f
Fixing a test error caused by grammar change.
afoucret Jun 6, 2025
235ebbd
Remove fork / rrf related changes.
afoucret Jun 10, 2025
ee4ce96
Remove useless files.
afoucret Jun 10, 2025
e20a8ec
Revert KQL related changes.
afoucret Jun 10, 2025
f4f20fe
Merge branch '8.19' of https://github.com/elastic/elasticsearch into …
afoucret Jun 10, 2025
2851d08
Fix test regression
afoucret Jun 10, 2025
453034b
Merge branch '8.19' of https://github.com/elastic/elasticsearch into …
afoucret Jun 10, 2025
2b8bc19
ES|QL Completion command syntax change (#129189)
afoucret Jun 10, 2025
203d635
Merge branch '8.19' of https://github.com/elastic/elasticsearch into …
afoucret Jun 10, 2025
3fa21cd
Fix failing test
afoucret Jun 10, 2025
6de5927
Merge branch '8.19' of https://github.com/elastic/elasticsearch into …
afoucret Jun 11, 2025
7e1556f
Fix an NPE in the ES|QL completion command. (#129235)
afoucret Jun 11, 2025
16b6e70
Merge branch '8.19' of https://github.com/elastic/elasticsearch into …
afoucret Jun 11, 2025
29898dc
Merge branch '8.19' of https://github.com/elastic/elasticsearch into …
afoucret Jun 16, 2025
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
5 changes: 5 additions & 0 deletions docs/changelog/123074.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
pr: 123074
summary: Adding ES|QL Reranker command in snapshot builds
area: Ranking
type: feature
issues: []
5 changes: 5 additions & 0 deletions docs/changelog/126319.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
pr: 126319
summary: COMPLETION command grammar and logical plan
area: ES|QL
type: feature
issues: []
5 changes: 5 additions & 0 deletions docs/changelog/127731.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
pr: 127731
summary: ESQL - Enable telemetry for COMPLETION command
area: Search
type: feature
issues: []
6 changes: 6 additions & 0 deletions docs/changelog/128948.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
pr: 128948
summary: ES|QL - Add COMPLETION command as a tech preview feature
area: ES|QL
type: feature
issues:
- 124405
4 changes: 3 additions & 1 deletion docs/reference/rest-api/usage.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,9 @@ GET /_xpack/usage
"lookup" : 0,
"inlinestats" : 0,
"lookup_join" : 0,
"change_point" : 0
"change_point" : 0,
"completion": 0,
"rerank": 0
},
"queries" : {
"rest" : {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ public static class Request extends BaseInferenceActionRequest {
public static final ParseField TOP_N = new ParseField("top_n");
public static final ParseField TIMEOUT = new ParseField("timeout");

public static Builder builder(String inferenceEntityId, TaskType taskType) {
return new Builder().setInferenceEntityId(inferenceEntityId).setTaskType(taskType);
}

static final ObjectParser<Request.Builder, Void> PARSER = new ObjectParser<>(NAME, Request.Builder::new);
static {
PARSER.declareStringArray(Request.Builder::setInput, INPUT);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,13 +189,11 @@ protected final List<Page> oneDriverPerPageList(Iterator<List<Page>> source, Sup
while (source.hasNext()) {
List<Page> in = source.next();
try (
Driver d = new Driver(
"test",
Driver d = TestDriverFactory.create(
driverContext(),
new CannedSourceOperator(in.iterator()),
operators.get(),
new PageConsumerOperator(result::add),
() -> {}
new PageConsumerOperator(result::add)
)
) {
runDriver(d);
Expand Down Expand Up @@ -275,13 +273,11 @@ protected final List<Page> drive(List<Operator> operators, Iterator<Page> input,
List<Page> results = new ArrayList<>();
boolean success = false;
try (
Driver d = new Driver(
"test",
Driver d = TestDriverFactory.create(
driverContext,
new CannedSourceOperator(input),
operators,
new TestResultPageSinkOperator(results::add),
() -> {}
new TestResultPageSinkOperator(results::add)
)
) {
runDriver(d);
Expand All @@ -303,22 +299,15 @@ public static void runDriver(List<Driver> drivers) {
int dummyDrivers = between(0, 10);
for (int i = 0; i < dummyDrivers; i++) {
drivers.add(
new Driver(
"test",
"dummy-session",
0,
0,
TestDriverFactory.create(
new DriverContext(BigArrays.NON_RECYCLING_INSTANCE, TestBlockFactory.getNonBreakingInstance()),
() -> "dummy-driver",
new SequenceLongBlockSourceOperator(
TestBlockFactory.getNonBreakingInstance(),
LongStream.range(0, between(1, 100)),
between(1, 100)
),
List.of(),
new PageConsumerOperator(page -> page.releaseBlocks()),
Driver.DEFAULT_STATUS_INTERVAL,
() -> {}
new PageConsumerOperator(Page::releaseBlocks)
)
);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

package org.elasticsearch.compute.test;

import org.elasticsearch.common.Randomness;
import org.elasticsearch.common.unit.ByteSizeValue;
import org.elasticsearch.compute.data.BlockFactory;
import org.elasticsearch.compute.data.LocalCircuitBreaker;
import org.elasticsearch.compute.operator.Driver;
import org.elasticsearch.compute.operator.DriverContext;
import org.elasticsearch.compute.operator.Operator;
import org.elasticsearch.compute.operator.SinkOperator;
import org.elasticsearch.compute.operator.SourceOperator;
import org.elasticsearch.core.Releasable;
import org.elasticsearch.core.Releasables;
import org.elasticsearch.indices.CrankyCircuitBreakerService;

import java.util.List;

public class TestDriverFactory {

/**
* This is a convenience factory to create a test driver instance
* that accepts fewer parameters
*/
public static Driver create(
DriverContext driverContext,
SourceOperator source,
List<Operator> intermediateOperators,
SinkOperator sink
) {
return create(driverContext, source, intermediateOperators, sink, () -> {});
}

public static Driver create(
DriverContext driverContext,
SourceOperator source,
List<Operator> intermediateOperators,
SinkOperator sink,
Releasable releasable
) {
// Do not wrap the local breaker for small local breakers, as the output mights not match expectations.
if (driverContext.breaker() instanceof CrankyCircuitBreakerService.CrankyCircuitBreaker == false
&& driverContext.breaker() instanceof LocalCircuitBreaker == false
&& driverContext.breaker().getLimit() >= ByteSizeValue.ofMb(100).getBytes()
&& Randomness.get().nextBoolean()) {
final int overReservedBytes = Randomness.get().nextInt(1024 * 1024);
final int maxOverReservedBytes = overReservedBytes + Randomness.get().nextInt(1024 * 1024);
var localBreaker = new LocalCircuitBreaker(driverContext.breaker(), overReservedBytes, maxOverReservedBytes);
BlockFactory localBlockFactory = driverContext.blockFactory().newChildFactory(localBreaker);
driverContext = new DriverContext(localBlockFactory.bigArrays(), localBlockFactory);
}
if (driverContext.breaker() instanceof LocalCircuitBreaker localBreaker) {
releasable = Releasables.wrap(releasable, localBreaker);
}
return new Driver(
"unset",
"test-task",
System.currentTimeMillis(),
System.nanoTime(),
driverContext,
() -> null,
source,
intermediateOperators,
sink,
Driver.DEFAULT_STATUS_INTERVAL,
releasable
);
}
}
Loading