Skip to content

Commit efa0839

Browse files
committed
Merge branch 'main' of https://github.com/elastic/elasticsearch into esql-text-embedding-function
2 parents a59b10e + 43db8d8 commit efa0839

File tree

118 files changed

+962
-342
lines changed

Some content is hidden

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

118 files changed

+962
-342
lines changed

docs/changelog/131032.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 131032
2+
summary: "Fix: `GET _synonyms` returns synonyms with empty rules"
3+
area: Relevance
4+
type: bug
5+
issues: []

docs/changelog/131081.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
pr: 131081
2+
summary: Fix knn search error when dimensions are not set
3+
area: Vector Search
4+
type: bug
5+
issues:
6+
- 129550

docs/reference/query-languages/esql/limitations.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,3 +250,6 @@ Work around this limitation by converting the field to single value with one of
250250
* CSV export from Discover shows no more than 10,000 rows. This limit only applies to the number of rows that are retrieved by the query and displayed in Discover. Queries and aggregations run on the full data set.
251251
* Querying many indices at once without any filters can cause an error in kibana which looks like `[esql] > Unexpected error from Elasticsearch: The content length (536885793) is bigger than the maximum allowed string (536870888)`. The response from {{esql}} is too long. Use [`DROP`](/reference/query-languages/esql/commands/processing-commands.md#esql-drop) or [`KEEP`](/reference/query-languages/esql/commands/processing-commands.md#esql-keep) to limit the number of fields returned.
252252

253+
## Known issues [esql-known-issues]
254+
255+
Refer to [Known issues](/release-notes/known-issues.md) for a list of known issues for {{esql}}.

docs/reference/query-languages/query-dsl/query-dsl-bool-query.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ A query that matches documents matching boolean combinations of other queries. T
1313
| --- | --- |
1414
| `must` | The clause (query) must appear in matching documents and will contribute to the score. Each query defined under a `must` acts as a logical "AND", returning only documents that match *all* the specified queries. |
1515
| `should` | The clause (query) should appear in the matching document. Each query defined under a `should` acts as a logical "OR", returning documents that match *any* of the specified queries. |
16-
| `filter` | The clause (query) must appear in matching documents. However unlike`must` the score of the query will be ignored. Filter clauses are executedin [filter context](/reference/query-languages/query-dsl/query-filter-context.md), meaning that scoring is ignoredand clauses are considered for caching. Each query defined under a `filter` acts as a logical "AND", returning only documents that match *all* the specified queries. |
17-
| `must_not` | The clause (query) must not appear in the matchingdocuments. Clauses are executed in [filter context](/reference/query-languages/query-dsl/query-filter-context.md) meaningthat scoring is ignored and clauses are considered for caching. Because scoring isignored, a score of `0` for all documents is returned. Each query defined under a `must_not` acts as a logical "NOT", returning only documents that do not match any of the specified queries. |
16+
| `filter` | The clause (query) must appear in matching documents. However unlike `must` the score of the query will be ignored. Filter clauses are executed in [filter context](/reference/query-languages/query-dsl/query-filter-context.md), meaning that scoring is ignored and clauses are considered for caching. Each query defined under a `filter` acts as a logical "AND", returning only documents that match *all* the specified queries. |
17+
| `must_not` | The clause (query) must not appear in the matching documents. Clauses are executed in [filter context](/reference/query-languages/query-dsl/query-filter-context.md) meaning that scoring is ignored and clauses are considered for caching. Because scoring is ignored, a score of `0` for all documents is returned. Each query defined under a `must_not` acts as a logical "NOT", returning only documents that do not match any of the specified queries. |
1818

1919
The `must` and `should` clauses function as logical AND, OR operators, contributing to the scoring of results. However, these results are not cached, which means repeated queries won't benefit from faster retrieval. In contrast, the `filter` and `must_not` clauses are used to include or exclude results without impacting the score, unless used within a `constant_score` query.
2020

docs/reference/query-languages/query-dsl/query-dsl-knn-query.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,6 @@ POST my-image-index/_search
165165

166166
Knn query can be used as a part of hybrid search, where knn query is combined with other lexical queries. For example, the query below finds documents with `title` matching `mountain lake`, and combines them with the top 10 documents that have the closest image vectors to the `query_vector`. The combined documents are then scored and the top 3 top scored documents are returned.
167167

168-
+
169168

170169
```console
171170
POST my-image-index/_search

docs/release-notes/known-issues.md

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,19 @@ mapped_pages:
88
Known issues are significant defects or limitations that may impact your implementation. These issues are actively being worked on and will be addressed in a future release. Review the Elasticsearch known issues to help you make informed decisions, such as upgrading to a new version.
99

1010
## 9.0.3 [elasticsearch-9.0.3-known-issues]
11-
A bug in the merge scheduler in Elasticsearch 9.0.3 may prevent shards from closing when there isn’t enough disk space to complete a merge. As a result, operations such as closing or relocating an index may hang until sufficient disk space becomes available.
11+
* A bug in the merge scheduler in Elasticsearch 9.0.3 may prevent shards from closing when there isn’t enough disk space to complete a merge. As a result, operations such as closing or relocating an index may hang until sufficient disk space becomes available.
1212
To mitigate this issue, the disk space checker is disabled by default in 9.0.3 by setting `indices.merge.disk.check_interval` to `0` seconds. Manually enabling this setting is not recommended.
1313

14-
This issue is planned to be fixed in future patch release [#129613](https://github.com/elastic/elasticsearch/pull/129613)
14+
This issue is planned to be fixed in future patch release [#129613](https://github.com/elastic/elasticsearch/pull/129613)
15+
16+
* A bug in the ES|QL STATS command may yield incorrect results. The bug only happens in very specific cases that follow this pattern: `STATS ... BY keyword1, keyword2`, i.e. the command must have exactly two grouping fields, both keywords, where the first field has high cardinality (more than 65k distinct values).
17+
18+
The bug is described in detail in [this issue](https://github.com/elastic/elasticsearch/issues/130644).
19+
The problem was introduced in 8.16.0 and [fixed](https://github.com/elastic/elasticsearch/pull/130705) in 8.17.9, 8.18.7, 9.0.4.
20+
21+
Possible workarounds include:
22+
* switching the order of the grouping keys (eg. `STATS ... BY keyword2, keyword1`, if the `keyword2` has a lower cardinality)
23+
* reducing the grouping key cardinality, by filtering out values before STATS
1524

1625
## 9.0.0 [elasticsearch-9.0.0-known-issues]
1726
* Elasticsearch on Windows might fail to start, or might forbid some file-related operations, when referencing paths with a case different from the one stored by the filesystem. Windows treats paths as case-insensitive, but the filesystem stores them with case. Entitlements, the new security system used by Elasticsearch, treat all paths as case-sensitive, and can therefore prevent access to a path that should be accessible.
@@ -40,3 +49,12 @@ This issue will be fixed in a future patch release (see [PR #126990](https://git
4049
DELETE _index_template/.watches
4150
POST /_watcher/_start
4251
```
52+
53+
* A bug in the ES|QL STATS command may yield incorrect results. The bug only happens in very specific cases that follow this pattern: `STATS ... BY keyword1, keyword2`, i.e. the command must have exactly two grouping fields, both keywords, where the first field has high cardinality (more than 65k distinct values).
54+
55+
The bug is described in detail in [this issue](https://github.com/elastic/elasticsearch/issues/130644).
56+
The problem was introduced in 8.16.0 and [fixed](https://github.com/elastic/elasticsearch/pull/130705) in 8.17.9, 8.18.7, 9.0.4.
57+
58+
Possible workarounds include:
59+
* switching the order of the grouping keys (eg. `STATS ... BY keyword2, keyword1`, if the `keyword2` has a lower cardinality)
60+
* reducing the grouping key cardinality, by filtering out values before STATS

libs/x-content/src/main/java/org/elasticsearch/xcontent/AbstractObjectParser.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
package org.elasticsearch.xcontent;
1111

1212
import org.elasticsearch.core.CheckedFunction;
13+
import org.elasticsearch.core.UpdateForV10;
1314
import org.elasticsearch.xcontent.ObjectParser.NamedObjectParser;
1415
import org.elasticsearch.xcontent.ObjectParser.ValueType;
1516

@@ -230,11 +231,13 @@ public void declareDoubleOrNull(BiConsumer<Value, Double> consumer, double nullV
230231
);
231232
}
232233

234+
@UpdateForV10(owner = UpdateForV10.Owner.CORE_INFRA) // https://github.com/elastic/elasticsearch/issues/130797
233235
public void declareLong(BiConsumer<Value, Long> consumer, ParseField field) {
234236
// Using a method reference here angers some compilers
235237
declareField(consumer, p -> p.longValue(), field, ValueType.LONG);
236238
}
237239

240+
@UpdateForV10(owner = UpdateForV10.Owner.CORE_INFRA) // https://github.com/elastic/elasticsearch/issues/130797
238241
public void declareLongOrNull(BiConsumer<Value, Long> consumer, long nullValue, ParseField field) {
239242
// Using a method reference here angers some compilers
240243
declareField(
@@ -245,6 +248,7 @@ public void declareLongOrNull(BiConsumer<Value, Long> consumer, long nullValue,
245248
);
246249
}
247250

251+
@UpdateForV10(owner = UpdateForV10.Owner.CORE_INFRA) // https://github.com/elastic/elasticsearch/issues/130797
248252
public void declareInt(BiConsumer<Value, Integer> consumer, ParseField field) {
249253
// Using a method reference here angers some compilers
250254
declareField(consumer, p -> p.intValue(), field, ValueType.INT);
@@ -253,6 +257,7 @@ public void declareInt(BiConsumer<Value, Integer> consumer, ParseField field) {
253257
/**
254258
* Declare an integer field that parses explicit {@code null}s in the json to a default value.
255259
*/
260+
@UpdateForV10(owner = UpdateForV10.Owner.CORE_INFRA) // https://github.com/elastic/elasticsearch/issues/130797
256261
public void declareIntOrNull(BiConsumer<Value, Integer> consumer, int nullValue, ParseField field) {
257262
declareField(
258263
consumer,
@@ -320,10 +325,12 @@ public void declareFloatArray(BiConsumer<Value, List<Float>> consumer, ParseFiel
320325
declareFieldArray(consumer, (p, c) -> p.floatValue(), field, ValueType.FLOAT_ARRAY);
321326
}
322327

328+
@UpdateForV10(owner = UpdateForV10.Owner.CORE_INFRA) // https://github.com/elastic/elasticsearch/issues/130797
323329
public void declareLongArray(BiConsumer<Value, List<Long>> consumer, ParseField field) {
324330
declareFieldArray(consumer, (p, c) -> p.longValue(), field, ValueType.LONG_ARRAY);
325331
}
326332

333+
@UpdateForV10(owner = UpdateForV10.Owner.CORE_INFRA) // https://github.com/elastic/elasticsearch/issues/130797
327334
public void declareIntArray(BiConsumer<Value, List<Integer>> consumer, ParseField field) {
328335
declareFieldArray(consumer, (p, c) -> p.intValue(), field, ValueType.INT_ARRAY);
329336
}

muted-tests.yml

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -461,9 +461,6 @@ tests:
461461
- class: org.elasticsearch.upgrades.MlJobSnapshotUpgradeIT
462462
method: testSnapshotUpgrader
463463
issue: https://github.com/elastic/elasticsearch/issues/98560
464-
- class: org.elasticsearch.upgrades.QueryableBuiltInRolesUpgradeIT
465-
method: testBuiltInRolesSyncedOnClusterUpgrade
466-
issue: https://github.com/elastic/elasticsearch/issues/129534
467464
- class: org.elasticsearch.search.query.VectorIT
468465
method: testFilteredQueryStrategy
469466
issue: https://github.com/elastic/elasticsearch/issues/129517
@@ -522,12 +519,6 @@ tests:
522519
- class: org.elasticsearch.xpack.esql.action.EsqlActionBreakerIT
523520
method: testTopNPushedToLucene
524521
issue: https://github.com/elastic/elasticsearch/issues/130505
525-
- class: org.elasticsearch.xpack.monitoring.exporter.http.HttpExporterTests
526-
method: testExporterWithHostOnly
527-
issue: https://github.com/elastic/elasticsearch/issues/130599
528-
- class: org.elasticsearch.xpack.monitoring.exporter.http.HttpExporterTests
529-
method: testCreateRestClient
530-
issue: https://github.com/elastic/elasticsearch/issues/130600
531522
- class: org.elasticsearch.xpack.esql.qa.multi_node.EsqlSpecIT
532523
method: test {match-operator.MatchWithMoreComplexDisjunctionAndConjunction SYNC}
533524
issue: https://github.com/elastic/elasticsearch/issues/130640
@@ -546,15 +537,6 @@ tests:
546537
- class: org.elasticsearch.xpack.esql.action.CrossClusterAsyncQueryStopIT
547538
method: testStopQueryLocal
548539
issue: https://github.com/elastic/elasticsearch/issues/121672
549-
- class: org.elasticsearch.xpack.esql.qa.multi_node.GenerativeIT
550-
method: test
551-
issue: https://github.com/elastic/elasticsearch/issues/130067
552-
- class: org.elasticsearch.xpack.esql.qa.single_node.GenerativeIT
553-
method: test
554-
issue: https://github.com/elastic/elasticsearch/issues/130067
555-
- class: org.elasticsearch.xpack.esql.action.EsqlRemoteErrorWrapIT
556-
method: testThatRemoteErrorsAreWrapped
557-
issue: https://github.com/elastic/elasticsearch/issues/130794
558540
- class: org.elasticsearch.backwards.MixedClusterClientYamlTestSuiteIT
559541
method: test {p0=mtermvectors/10_basic/Tests catching other exceptions per item}
560542
issue: https://github.com/elastic/elasticsearch/issues/122414
@@ -576,6 +558,9 @@ tests:
576558
- class: org.elasticsearch.xpack.esql.action.EsqlActionBreakerIT
577559
method: testRowStatsProjectGroupByInt
578560
issue: https://github.com/elastic/elasticsearch/issues/131024
561+
- class: org.elasticsearch.common.util.concurrent.TaskExecutionTimeTrackingEsThreadPoolExecutorTests
562+
method: testMaxQueueLatency
563+
issue: https://github.com/elastic/elasticsearch/issues/131093
579564

580565
# Examples:
581566
#

rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/search.vectors/40_knn_search.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -670,3 +670,36 @@ setup:
670670
properties:
671671
embedding:
672672
type: dense_vector
673+
674+
675+
---
676+
"Searching with no data dimensions specified":
677+
- requires:
678+
cluster_features: "search.vectors.no_dimensions_bugfix"
679+
reason: "Search with no dimensions bugfix"
680+
681+
- do:
682+
indices.create:
683+
index: empty-test
684+
body:
685+
mappings:
686+
properties:
687+
vector:
688+
type: dense_vector
689+
index: true
690+
691+
- do:
692+
search:
693+
index: empty-test
694+
body:
695+
fields: [ "name" ]
696+
knn:
697+
field: vector
698+
query_vector: [ -0.5, 90.0, -10, 14.8, -156.0 ]
699+
k: 3
700+
num_candidates: 3
701+
rescore_vector:
702+
oversample: 1.5
703+
similarity: 0.1
704+
705+
- match: { hits.total.value: 0 }

rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/synonyms/40_synonyms_sets_get.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,3 +157,33 @@ setup:
157157

158158
- match:
159159
count: 12
160+
161+
---
162+
"Return empty rule set":
163+
- requires:
164+
cluster_features: [ synonyms_set.get.return_empty_synonym_sets ]
165+
reason: "synonyms_set get api return empty synonym sets"
166+
167+
- do:
168+
synonyms.put_synonym:
169+
id: empty-synonyms
170+
body:
171+
synonyms_set: []
172+
173+
- do:
174+
synonyms.get_synonyms_sets: {}
175+
176+
- match:
177+
count: 4
178+
179+
- match:
180+
results:
181+
- synonyms_set: "empty-synonyms"
182+
count: 0
183+
- synonyms_set: "test-synonyms-1"
184+
count: 3
185+
- synonyms_set: "test-synonyms-2"
186+
count: 1
187+
- synonyms_set: "test-synonyms-3"
188+
count: 2
189+

0 commit comments

Comments
 (0)