Skip to content

Commit a022b5c

Browse files
authored
Merge branch 'main' into markjhoy/default_token_pruning_sparse_vector
2 parents 92db1c6 + 89134fe commit a022b5c

File tree

71 files changed

+1443
-399
lines changed

Some content is hidden

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

71 files changed

+1443
-399
lines changed

docs/changelog/127299.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 127299
2+
summary: Introduce `AggregateMetricDoubleBlock`
3+
area: ES|QL
4+
type: enhancement
5+
issues: []

docs/changelog/127337.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
pr: 127337
2+
summary: Http proxy support in JWT realm
3+
area: Authentication
4+
type: enhancement
5+
issues:
6+
- 114956

docs/reference/elasticsearch/mapping-reference/semantic-text.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ PUT my-index-000003
9292
## Parameters for `semantic_text` fields [semantic-text-params]
9393

9494
`inference_id`
95-
: (Required, string) {{infer-cap}} endpoint that will be used to generate
95+
: (Optional, string) {{infer-cap}} endpoint that will be used to generate
9696
embeddings for the field. By default, `.elser-2-elasticsearch` is used. This
9797
parameter cannot be updated. Use
9898
the [Create {{infer}} API](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-put)

modules/ingest-geoip/src/main/java/org/elasticsearch/ingest/geoip/GeoIpDownloaderTaskExecutor.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,8 @@ public final class GeoIpDownloaderTaskExecutor extends PersistentTasksExecutor<G
7171
"ingest.geoip.downloader.enabled",
7272
ENABLED_DEFAULT,
7373
Setting.Property.Dynamic,
74-
Setting.Property.NodeScope
74+
Setting.Property.NodeScope,
75+
Setting.Property.ProjectScope
7576
);
7677
public static final Setting<TimeValue> POLL_INTERVAL_SETTING = Setting.timeSetting(
7778
"ingest.geoip.downloader.poll.interval",

muted-tests.yml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -399,9 +399,6 @@ tests:
399399
- class: org.elasticsearch.packaging.test.DockerTests
400400
method: test024InstallPluginFromArchiveUsingConfigFile
401401
issue: https://github.com/elastic/elasticsearch/issues/126936
402-
- class: org.elasticsearch.search.aggregations.bucket.FiltersIT
403-
method: testSimpleWithFilterQuery
404-
issue: https://github.com/elastic/elasticsearch/issues/127099
405402
- class: org.elasticsearch.xpack.esql.qa.multi_node.EsqlSpecIT
406403
method: test {rerank.Reranker before a limit ASYNC}
407404
issue: https://github.com/elastic/elasticsearch/issues/127051
@@ -435,6 +432,18 @@ tests:
435432
- class: org.elasticsearch.xpack.esql.qa.mixed.MixedClusterEsqlSpecIT
436433
method: test {union_types.MultiIndexSortIpStringEval ASYNC}
437434
issue: https://github.com/elastic/elasticsearch/issues/127537
435+
- class: org.elasticsearch.xpack.inference.action.filter.ShardBulkInferenceActionFilterIT
436+
method: testRestart {p0=false p1=false}
437+
issue: https://github.com/elastic/elasticsearch/issues/127592
438+
- class: org.elasticsearch.xpack.inference.action.filter.ShardBulkInferenceActionFilterIT
439+
method: testRestart {p0=true p1=false}
440+
issue: https://github.com/elastic/elasticsearch/issues/127593
441+
- class: org.elasticsearch.xpack.inference.action.filter.ShardBulkInferenceActionFilterIT
442+
method: testRestart {p0=false p1=true}
443+
issue: https://github.com/elastic/elasticsearch/issues/127594
444+
- class: org.elasticsearch.xpack.inference.action.filter.ShardBulkInferenceActionFilterIT
445+
method: testRestart {p0=true p1=true}
446+
issue: https://github.com/elastic/elasticsearch/issues/127595
438447

439448
# Examples:
440449
#

server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/FiltersIT.java

Lines changed: 27 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -97,114 +97,53 @@ public void setupSuiteScopeCluster() throws Exception {
9797
ensureSearchable();
9898
}
9999

100-
// This test replicates a strange filter query & filters aggregation behavior
101-
// we apparently utilize competitive iterators strangely.
102-
// See: https://github.com/elastic/elasticsearch/issues/126955
103100
public void testSimpleWithFilterQuery() throws Exception {
104101
createIndex("filters_idx");
105-
String groupFieldName = "group";
106-
String subGroupFieldName = "subGroup";
102+
String fieldAName = "fieldA";
103+
String fieldBName = "fieldB";
107104

108-
int numTotalGroup0 = 500;
109-
String group0Name = "group0";
105+
int totalItems = 1024;
110106

111-
int numTotalGroup1 = 1000;
112-
String group1Name = "group1";
113-
114-
int subGroup0 = 100;
115-
String subGroup0Name = "subGroup0";
116-
117-
int subGroup1 = 50;
118-
String subGroup1Name = "subGroup1";
119-
120-
int subGroup2 = 25;
121-
String subGroup2Name = "subGroup2";
122-
int others = 10;
123-
String otherName = "others";
124107
List<IndexRequestBuilder> builders = new ArrayList<>();
125-
for (int i = 0; i < numTotalGroup0; i++) {
126-
for (int j = 0; j < subGroup0; j++) {
127-
XContentBuilder source = jsonBuilder().startObject()
128-
.field(groupFieldName, group0Name)
129-
.field(subGroupFieldName, subGroup0Name)
130-
.endObject();
131-
builders.add(prepareIndex("filters_idx").setSource(source));
132-
}
133-
for (int j = 0; j < subGroup1; j++) {
134-
XContentBuilder source = jsonBuilder().startObject()
135-
.field(groupFieldName, group0Name)
136-
.field(subGroupFieldName, subGroup1Name)
137-
.endObject();
138-
builders.add(prepareIndex("filters_idx").setSource(source));
139-
}
140-
for (int j = 0; j < subGroup2; j++) {
141-
XContentBuilder source = jsonBuilder().startObject()
142-
.field(groupFieldName, group0Name)
143-
.field(subGroupFieldName, subGroup2Name)
144-
.endObject();
145-
builders.add(prepareIndex("filters_idx").setSource(source));
146-
}
147-
for (int j = 0; j < others; j++) {
148-
XContentBuilder source = jsonBuilder().startObject()
149-
.field(groupFieldName, group0Name)
150-
.field(subGroupFieldName, otherName)
151-
.endObject();
152-
builders.add(prepareIndex("filters_idx").setSource(source));
153-
}
108+
for (int i = 0; i < totalItems; i++) {
109+
XContentBuilder source = jsonBuilder().startObject().field(fieldAName, "0").field(fieldBName, "" + i % 2).endObject();
110+
builders.add(prepareIndex("filters_idx").setId("" + i).setSource(source));
154111
}
155-
for (int i = 0; i < numTotalGroup1; i++) {
156-
for (int j = 0; j < subGroup0; j++) {
157-
XContentBuilder source = jsonBuilder().startObject()
158-
.field(groupFieldName, group1Name)
159-
.field(subGroupFieldName, subGroup0Name)
160-
.endObject();
161-
builders.add(prepareIndex("filters_idx").setSource(source));
162-
}
163-
for (int j = 0; j < subGroup1; j++) {
164-
XContentBuilder source = jsonBuilder().startObject()
165-
.field(groupFieldName, group1Name)
166-
.field(subGroupFieldName, subGroup1Name)
167-
.endObject();
168-
builders.add(prepareIndex("filters_idx").setSource(source));
169-
}
170-
for (int j = 0; j < subGroup2; j++) {
171-
XContentBuilder source = jsonBuilder().startObject()
172-
.field(groupFieldName, group1Name)
173-
.field(subGroupFieldName, subGroup2Name)
174-
.endObject();
175-
builders.add(prepareIndex("filters_idx").setSource(source));
176-
}
177-
for (int j = 0; j < others; j++) {
178-
XContentBuilder source = jsonBuilder().startObject()
179-
.field(groupFieldName, group1Name)
180-
.field(subGroupFieldName, otherName)
181-
.endObject();
182-
builders.add(prepareIndex("filters_idx").setSource(source));
183-
}
184-
}
185-
indexRandom(true, false, true, builders);
112+
indexRandom(true, builders);
186113
ensureSearchable();
187114
assertNoFailuresAndResponse(
188115
prepareSearch("filters_idx").setSize(0)
189116
.setRequestCache(false)
190117
.setTrackTotalHits(true)
191-
.setQuery(boolQuery().filter(termQuery(groupFieldName + ".keyword", group0Name)))
118+
.setQuery(boolQuery().filter(termsQuery(fieldAName + ".keyword", "0")))
192119
.addAggregation(
193120
filters(
194121
"results",
195-
new KeyedFilter(subGroup0Name, termsQuery(subGroupFieldName + ".keyword", subGroup0Name)),
196-
new KeyedFilter(subGroup1Name, termsQuery(subGroupFieldName + ".keyword", subGroup1Name)),
197-
new KeyedFilter(subGroup2Name, termsQuery(subGroupFieldName + ".keyword", subGroup2Name))
198-
// This is key
122+
new KeyedFilter("zero", termQuery(fieldBName + ".keyword", "0")),
123+
new KeyedFilter("one", termQuery(fieldBName + ".keyword", "1"))
199124
).otherBucket(false)
200125
),
201126
searchResponse -> {
202127
Filters filters = searchResponse.getAggregations().get("results");
203128
assertThat(filters, notNullValue());
204129
assertThat(filters.getName(), equalTo("results"));
205-
Filters.Bucket bucket = filters.getBucketByKey(subGroup0Name);
206-
assertThat(bucket, Matchers.notNullValue());
207-
assertThat(bucket.getDocCount(), equalTo((long) subGroup0 * numTotalGroup0));
130+
assertThat(filters.getBuckets().size(), equalTo(2));
131+
assertThat(filters.getBucketByKey("zero").getDocCount(), equalTo(512L));
132+
assertThat(filters.getBucketByKey("one").getDocCount(), equalTo(512L));
133+
}
134+
);
135+
assertNoFailuresAndResponse(
136+
prepareSearch("filters_idx").setSize(0)
137+
.setRequestCache(false)
138+
.setTrackTotalHits(true)
139+
.setQuery(boolQuery().filter(termsQuery(fieldAName + ".keyword", "0")))
140+
.addAggregation(filters("results", new KeyedFilter("one", termQuery(fieldBName + ".keyword", "1"))).otherBucket(false)),
141+
searchResponse -> {
142+
Filters filters = searchResponse.getAggregations().get("results");
143+
assertThat(filters, notNullValue());
144+
assertThat(filters.getName(), equalTo("results"));
145+
assertThat(filters.getBuckets().size(), equalTo(1));
146+
assertThat(filters.getBucketByKey("one").getDocCount(), equalTo(512L));
208147
}
209148
);
210149
}

server/src/main/java/org/elasticsearch/TransportVersions.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,9 @@ static TransportVersion def(int id) {
229229
public static final TransportVersion RANDOM_SAMPLER_QUERY_BUILDER = def(9_063_0_00);
230230
public static final TransportVersion SETTINGS_IN_DATA_STREAMS = def(9_064_0_00);
231231
public static final TransportVersion INTRODUCE_FAILURES_LIFECYCLE = def(9_065_0_00);
232-
public static final TransportVersion SPARSE_VECTOR_FIELD_PRUNING_OPTIONS = def(9_066_0_00);
232+
public static final TransportVersion PROJECT_METADATA_SETTINGS = def(9_066_00_0);
233+
public static final TransportVersion AGGREGATE_METRIC_DOUBLE_BLOCK = def(9_067_00_0);
234+
public static final TransportVersion SPARSE_VECTOR_FIELD_PRUNING_OPTIONS = def(9_068_0_00);
233235

234236
/*
235237
* STOP! READ THIS FIRST! No, really,

server/src/main/java/org/elasticsearch/cluster/metadata/Metadata.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -950,7 +950,13 @@ private MetadataDiff(StreamInput in) throws IOException {
950950
RESERVED_DIFF_VALUE_READER
951951
);
952952

953-
singleProject = new ProjectMetadata.ProjectMetadataDiff(indices, templates, projectCustoms, DiffableUtils.emptyDiff());
953+
singleProject = new ProjectMetadata.ProjectMetadataDiff(
954+
indices,
955+
templates,
956+
projectCustoms,
957+
DiffableUtils.emptyDiff(),
958+
Settings.EMPTY_DIFF
959+
);
954960
multiProject = null;
955961
} else {
956962
fromNodeBeforeMultiProjectsSupport = false;

0 commit comments

Comments
 (0)