Skip to content

Commit 5219b40

Browse files
committed
Merge branch 'main' into handle-empty-chunked-infer-input
2 parents 7208c45 + f76ca18 commit 5219b40

File tree

155 files changed

+3762
-2116
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

155 files changed

+3762
-2116
lines changed

docs/changelog/138051.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 138051
2+
summary: Support for parameters in LIKE and RLIKE
3+
area: ES|QL
4+
type: enhancement
5+
issues: []

docs/changelog/138644.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 138644
2+
summary: "Fix: add missing `vector_similarity_support` in InferenceFeatures"
3+
area: Search
4+
type: bug
5+
issues: []

docs/reference/query-languages/esql/_snippets/operators/detailedDescription/like.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,15 @@ ROW message = "foobar"
3131
```
3232

3333

34+
Patterns may be specified with REST query placeholders as well
35+
36+
```esql
37+
FROM employees
38+
| WHERE first_name LIKE ?pattern
39+
| KEEP first_name, last_name
40+
```
41+
42+
```{applies_to}
43+
stack: ga 9.3
44+
```
45+

docs/reference/query-languages/esql/_snippets/operators/detailedDescription/rlike.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,15 @@ ROW message = "foobar"
3131
```
3232

3333

34+
Patterns may be specified with REST query placeholders as well
35+
36+
```esql
37+
FROM employees
38+
| WHERE first_name RLIKE ?pattern
39+
| KEEP first_name, last_name
40+
```
41+
42+
```{applies_to}
43+
stack: ga 9.3
44+
```
45+

modules/ingest-geoip/src/yamlRestTest/java/org/elasticsearch/ingest/geoip/IngestGeoIpClientYamlTestSuiteIT.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
import java.util.List;
3939
import java.util.Map;
4040
import java.util.Objects;
41+
import java.util.concurrent.TimeUnit;
4142

4243
import static org.hamcrest.Matchers.containsInAnyOrder;
4344
import static org.hamcrest.Matchers.equalTo;
@@ -158,7 +159,9 @@ static void assertDatabasesLoaded() throws Exception {
158159

159160
// ensure that the extra config database has been set up, too:
160161
assertThat(node.get("config_databases"), equalTo(List.of("asn.mmdb")));
161-
});
162+
// Downloading all four databases may take some time, so we set a longer timeout here.
163+
// If 20 seconds prove insufficient, we should first investigate whether we can speed up the database downloader.
164+
}, 20, TimeUnit.SECONDS);
162165
}
163166

164167
@SuppressForbidden(reason = "fixtures use java.io.File based APIs")

modules/reindex/src/test/java/org/elasticsearch/reindex/ClientScrollableHitSourceTests.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
import java.util.stream.IntStream;
5151

5252
import static org.apache.lucene.tests.util.TestUtil.randomSimpleString;
53+
import static org.elasticsearch.common.bytes.BytesReferenceTestUtils.equalBytes;
5354
import static org.elasticsearch.core.TimeValue.timeValueSeconds;
5455
import static org.hamcrest.Matchers.instanceOf;
5556

@@ -174,7 +175,7 @@ private SearchResponse createSearchResponse() {
174175
private void assertSameHits(List<? extends ScrollableHitSource.Hit> actual, SearchHit[] expected) {
175176
assertEquals(actual.size(), expected.length);
176177
for (int i = 0; i < actual.size(); ++i) {
177-
assertEquals(actual.get(i).getSource(), expected[i].getSourceRef());
178+
assertThat(expected[i].getSourceRef(), equalBytes(actual.get(i).getSource()));
178179
assertEquals(actual.get(i).getIndex(), expected[i].getIndex());
179180
assertEquals(actual.get(i).getVersion(), expected[i].getVersion());
180181
assertEquals(actual.get(i).getPrimaryTerm(), expected[i].getPrimaryTerm());

modules/reindex/src/test/java/org/elasticsearch/reindex/RoundTripTests.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
import java.util.Map;
3939

4040
import static org.apache.lucene.tests.util.TestUtil.randomSimpleString;
41+
import static org.elasticsearch.common.bytes.BytesReferenceTestUtils.equalBytes;
4142

4243
/**
4344
* Round trip tests for all {@link Writeable} things declared in this plugin.
@@ -144,7 +145,7 @@ private void assertRequestEquals(ReindexRequest request, ReindexRequest tripped)
144145
assertNotNull(tripped.getRemoteInfo());
145146
assertEquals(request.getRemoteInfo().getScheme(), tripped.getRemoteInfo().getScheme());
146147
assertEquals(request.getRemoteInfo().getHost(), tripped.getRemoteInfo().getHost());
147-
assertEquals(request.getRemoteInfo().getQuery(), tripped.getRemoteInfo().getQuery());
148+
assertThat(tripped.getRemoteInfo().getQuery(), equalBytes(request.getRemoteInfo().getQuery()));
148149
assertEquals(request.getRemoteInfo().getUsername(), tripped.getRemoteInfo().getUsername());
149150
assertEquals(request.getRemoteInfo().getPassword(), tripped.getRemoteInfo().getPassword());
150151
assertEquals(request.getRemoteInfo().getHeaders(), tripped.getRemoteInfo().getHeaders());

modules/repository-gcs/src/internalClusterTest/java/org/elasticsearch/repositories/gcs/GoogleCloudStorageBlobStoreRepositoryTests.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@
5959
import java.util.Collections;
6060
import java.util.Map;
6161

62+
import static org.elasticsearch.common.bytes.BytesReferenceTestUtils.equalBytes;
6263
import static org.elasticsearch.common.io.Streams.readFully;
6364
import static org.elasticsearch.repositories.blobstore.BlobStoreTestUtil.randomPurpose;
6465
import static org.elasticsearch.repositories.gcs.GoogleCloudStorageClientSettings.CREDENTIALS_FILE_SETTING;
@@ -219,7 +220,7 @@ public void testWriteFileMultipleOfChunkSize() throws IOException {
219220
container.writeBlob(randomPurpose(), key, new BytesArray(initialValue), true);
220221

221222
BytesReference reference = readFully(container.readBlob(randomPurpose(), key));
222-
assertEquals(new BytesArray(initialValue), reference);
223+
assertThat(reference, equalBytes(new BytesArray(initialValue)));
223224

224225
container.deleteBlobsIgnoringIfNotExists(randomPurpose(), Iterators.single(key));
225226
}

modules/repository-gcs/src/test/java/org/elasticsearch/repositories/gcs/GoogleCloudStorageBlobContainerRetriesTests.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@
7979

8080
import static fixture.gcs.TestUtils.createServiceAccount;
8181
import static java.nio.charset.StandardCharsets.UTF_8;
82+
import static org.elasticsearch.common.bytes.BytesReferenceTestUtils.equalBytes;
8283
import static org.elasticsearch.common.io.Streams.readFully;
8384
import static org.elasticsearch.repositories.blobstore.BlobStoreTestUtil.randomPurpose;
8485
import static org.elasticsearch.repositories.blobstore.ESBlobStoreRepositoryIntegTestCase.randomBytes;
@@ -582,7 +583,7 @@ public void testCompareAndExchangeWhenThrottled() throws IOException {
582583
final OptionalBytesReference updateResult = safeAwait(
583584
l -> container.compareAndExchangeRegister(randomPurpose(), key, new BytesArray(data), new BytesArray(updatedData), l)
584585
);
585-
assertEquals(new BytesArray(data), updateResult.bytesReference());
586+
assertThat(updateResult.bytesReference(), equalBytes(new BytesArray(data)));
586587

587588
assertEquals(0, requestHandlers.size());
588589
container.delete(randomPurpose());
@@ -601,7 +602,7 @@ public void testContentsChangeWhileStreaming() throws IOException {
601602
container.writeBlob(randomPurpose(), key, new BytesArray(initialValue), true);
602603

603604
BytesReference reference = readFully(container.readBlob(randomPurpose(), key));
604-
assertEquals(new BytesArray(initialValue), reference);
605+
assertThat(reference, equalBytes(new BytesArray(initialValue)));
605606

606607
try (InputStream inputStream = container.readBlob(randomPurpose(), key)) {
607608
// Trigger the first chunk to load

modules/repository-gcs/src/test/java/org/elasticsearch/repositories/gcs/GoogleCloudStorageBlobContainerStatsTests.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
import java.util.Map;
5151
import java.util.concurrent.TimeUnit;
5252

53+
import static org.elasticsearch.common.bytes.BytesReferenceTestUtils.equalBytes;
5354
import static org.elasticsearch.repositories.blobstore.BlobStoreTestUtil.randomPurpose;
5455
import static org.elasticsearch.repositories.gcs.GoogleCloudStorageClientSettings.APPLICATION_NAME_SETTING;
5556
import static org.elasticsearch.repositories.gcs.GoogleCloudStorageClientSettings.CONNECT_TIMEOUT_SETTING;
@@ -138,7 +139,7 @@ public void testSingleMultipartWrite() throws Exception {
138139
final StatsMap wantStats = new StatsMap(purpose);
139140
assertStatsEquals(wantStats.add(INSERT, 1), store.stats());
140141
try (InputStream is = container.readBlob(purpose, blobName)) {
141-
assertEquals(blobContents, Streams.readFully(is));
142+
assertThat(Streams.readFully(is), equalBytes(blobContents));
142143
}
143144
assertStatsEquals(wantStats.add(GET, 1), store.stats());
144145
}
@@ -164,7 +165,7 @@ public void testResumableWrite() throws Exception {
164165
assertStatsEquals(wantStats.add(INSERT, 1, totalRequests), store.stats());
165166

166167
try (InputStream is = container.readBlob(purpose, blobName)) {
167-
assertEquals(blobContents, Streams.readFully(is));
168+
assertThat(Streams.readFully(is), equalBytes(blobContents));
168169
}
169170
assertStatsEquals(wantStats.add(GET, 1), store.stats());
170171
}

0 commit comments

Comments
 (0)