Skip to content

Commit d5185a6

Browse files
committed
Merge branch 'main' into rename-text-embeddings-to-dense-embeddings
2 parents d491a8b + 7625490 commit d5185a6

File tree

124 files changed

+1579
-922
lines changed

Some content is hidden

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

124 files changed

+1579
-922
lines changed

docs/changelog/136143.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
pr: 136143
2+
summary: Optionally ignore field when indexed field name exceeds length limit
3+
area: Mapping
4+
type: enhancement
5+
issues:
6+
- 135700

docs/changelog/136448.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
pr: 136448
2+
summary: Add `m` alias for `minute` duration literal
3+
area: ES|QL
4+
type: enhancement
5+
issues:
6+
- 135552

docs/reference/elasticsearch/index-settings/mapping-limit.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ $$$ignore-dynamic-beyond-limit$$$
4646
`index.mapping.field_name_length.limit`
4747
: Setting for the maximum length of a field name. This setting isn’t really something that addresses mappings explosion but might still be useful if you want to limit the field length. It usually shouldn’t be necessary to set this setting. The default is okay unless a user starts to add a huge number of fields with really long names. Default is `Long.MAX_VALUE` (no limit).
4848

49+
`index.mapping.field_name_length.ignore_dynamic_beyond_limit` {applies_to}`stack: ga 9.3`
50+
: This setting determines what happens when a the name of a dynamically mapped field would exceed the configured maximum length. When set to `false` (the default), the index request of the document that tries to add a dynamic field to the mapping will fail with the message `Field name [x] is longer than the limit of [y] characters`. When set to `true`, the index request will not fail. Instead, fields that would exceed the limit are not added to the mapping, similar to [`dynamic: false`](/reference/elasticsearch/mapping-reference/dynamic.md). The fields that were not added to the mapping will be added to the [`_ignored` field](/reference/elasticsearch/mapping-reference/mapping-ignored-field.md). The default value is `false`.
51+
4952
`index.mapping.dimension_fields.limit`
5053
: (Dynamic, integer) Maximum number of [time series dimensions](docs-content://manage-data/data-store/data-streams/time-series-data-stream-tsds.md#time-series-dimension) for the index. Defaults to `32768`.
5154

docs/reference/query-languages/esql/esql-time-spans.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ POST /_query
120120
| week | w, weeks |
121121
| day | d, days |
122122
| hour | h, hours |
123-
| minute | min, minutes |
123+
| minute | m, min, minutes |
124124
| second | s, sec, seconds |
125125
| millisecond | ms, milliseconds |
126126

muted-tests.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -281,9 +281,6 @@ tests:
281281
- class: org.elasticsearch.xpack.profiling.action.GetStatusActionIT
282282
method: testWaitsUntilResourcesAreCreated
283283
issue: https://github.com/elastic/elasticsearch/issues/129486
284-
- class: org.elasticsearch.upgrades.MlJobSnapshotUpgradeIT
285-
method: testSnapshotUpgrader
286-
issue: https://github.com/elastic/elasticsearch/issues/98560
287284
- class: org.elasticsearch.search.query.VectorIT
288285
method: testFilteredQueryStrategy
289286
issue: https://github.com/elastic/elasticsearch/issues/129517
@@ -666,6 +663,9 @@ tests:
666663
- class: org.elasticsearch.xpack.inference.integration.SemanticTextInferenceFieldsIT
667664
method: testExcludeInferenceFieldsFromSourceOldIndexVersions
668665
issue: https://github.com/elastic/elasticsearch/issues/136452
666+
- class: org.elasticsearch.xpack.remotecluster.CrossClusterEsqlRCS2UnavailableRemotesIT
667+
method: testEsqlRcs2UnavailableRemoteScenarios
668+
issue: https://github.com/elastic/elasticsearch/issues/136493
669669

670670
# Examples:
671671
#
Lines changed: 213 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,213 @@
1+
setup:
2+
- requires:
3+
cluster_features: ["mapper.ignore_dynamic_field_names_beyond_limit"]
4+
reason: "setting must be present to be tested"
5+
6+
---
7+
8+
"Test field name length limit":
9+
- do:
10+
indices.create:
11+
index: test_index
12+
body:
13+
settings:
14+
index:
15+
mapping:
16+
field_name_length:
17+
ignore_dynamic_beyond_limit: true
18+
limit: 45
19+
mappings:
20+
dynamic: true
21+
22+
- do:
23+
index:
24+
index: test_index
25+
id: 1
26+
refresh: true
27+
body:
28+
foo:
29+
test_really_long_field_name_that_will_be_ignored: foo
30+
field_name_not_ignored: 10
31+
32+
- do:
33+
indices.get_mapping:
34+
index: test_index
35+
36+
- match: { test_index.mappings.properties.foo.properties.test_really_long_field_name_that_will_be_ignored: null }
37+
- match: { test_index.mappings.properties.foo.properties.field_name_not_ignored.type: long }
38+
39+
- do:
40+
get:
41+
index: test_index
42+
id: 1
43+
_source: true
44+
stored_fields: [_ignored]
45+
- match:
46+
_source:
47+
foo:
48+
test_really_long_field_name_that_will_be_ignored: foo
49+
field_name_not_ignored: 10
50+
- match: { _ignored: [ "foo.test_really_long_field_name_that_will_be_ignored" ] }
51+
52+
---
53+
54+
"Test field name length limit array":
55+
- do:
56+
indices.create:
57+
index: test_index
58+
body:
59+
settings:
60+
index:
61+
mapping:
62+
field_name_length:
63+
ignore_dynamic_beyond_limit: true
64+
limit: 45
65+
mappings:
66+
dynamic: true
67+
68+
- do:
69+
index:
70+
index: test_index
71+
id: 1
72+
refresh: true
73+
body:
74+
foo:
75+
test_really_long_field_name_that_will_be_ignored: [ foo, bar, baz ]
76+
field_name_not_ignored: [ 10, 20, 30 ]
77+
78+
- do:
79+
indices.get_mapping:
80+
index: test_index
81+
82+
- match: { test_index.mappings.properties.foo.properties.test_really_long_field_name_that_will_be_ignored: null }
83+
- match: { test_index.mappings.properties.foo.properties.field_name_not_ignored.type: long }
84+
85+
- do:
86+
get:
87+
index: test_index
88+
id: 1
89+
_source: true
90+
stored_fields: [ _ignored ]
91+
92+
- match:
93+
_source:
94+
foo:
95+
test_really_long_field_name_that_will_be_ignored: [ foo, bar, baz ]
96+
field_name_not_ignored: [ 10, 20, 30 ]
97+
- match: {_ignored:["foo.test_really_long_field_name_that_will_be_ignored"]}
98+
99+
---
100+
101+
"Test field name length limit synthetic source":
102+
- do:
103+
indices.create:
104+
index: test_index
105+
body:
106+
settings:
107+
index:
108+
mapping:
109+
source.mode: synthetic
110+
field_name_length:
111+
ignore_dynamic_beyond_limit: true
112+
limit: 45
113+
mappings:
114+
dynamic: true
115+
116+
- do:
117+
index:
118+
index: test_index
119+
id: 1
120+
refresh: true
121+
body:
122+
foo:
123+
test_really_long_field_name_that_will_be_ignored: foo
124+
field_name_not_ignored: 10
125+
126+
- do:
127+
indices.get_mapping:
128+
index: test_index
129+
130+
- match: { test_index.mappings.properties.foo.properties.test_really_long_field_name_that_will_be_ignored: null }
131+
- match: { test_index.mappings.properties.foo.properties.field_name_not_ignored.type: long }
132+
133+
- do:
134+
get:
135+
index: test_index
136+
id: 1
137+
_source: true
138+
stored_fields: [ _ignored ]
139+
- match:
140+
_source:
141+
foo:
142+
test_really_long_field_name_that_will_be_ignored: foo
143+
field_name_not_ignored: 10
144+
- match: {_ignored:["foo.test_really_long_field_name_that_will_be_ignored"]}
145+
146+
---
147+
148+
"Test field name length limit array synthetic source":
149+
- do:
150+
indices.create:
151+
index: test_index
152+
body:
153+
settings:
154+
index:
155+
mapping:
156+
source.mode: synthetic
157+
field_name_length:
158+
ignore_dynamic_beyond_limit: true
159+
limit: 45
160+
mappings:
161+
dynamic: true
162+
163+
- do:
164+
index:
165+
index: test_index
166+
id: 1
167+
refresh: true
168+
body:
169+
foo:
170+
test_really_long_field_name_that_will_be_ignored: [ foo, bar, baz ]
171+
field_name_not_ignored: [ 10, 20, 30 ]
172+
173+
- do:
174+
indices.get_mapping:
175+
index: test_index
176+
177+
- match: { test_index.mappings.properties.foo.properties.test_really_long_field_name_that_will_be_ignored: null }
178+
- match: { test_index.mappings.properties.foo.properties.field_name_not_ignored.type: long }
179+
180+
- do:
181+
get:
182+
index: test_index
183+
id: 1
184+
_source: true
185+
stored_fields: [ _ignored ]
186+
- match:
187+
_source:
188+
foo:
189+
test_really_long_field_name_that_will_be_ignored: [ foo, bar, baz ]
190+
field_name_not_ignored: [ 10, 20, 30 ]
191+
- match: {_ignored:["foo.test_really_long_field_name_that_will_be_ignored"]}
192+
193+
---
194+
195+
"Test field name length limit with static mapping":
196+
- do:
197+
catch: /illegal_argument_exception/
198+
indices.create:
199+
index: test_index
200+
body:
201+
settings:
202+
index:
203+
mapping:
204+
field_name_length:
205+
ignore_dynamic_beyond_limit: true
206+
limit: 45
207+
mappings:
208+
dynamic: false
209+
properties:
210+
test_really_long_field_name_that_will_be_ignored:
211+
type: text
212+
213+
- match: {error.reason: "Field name [test_really_long_field_name_that_will_be_ignored] is longer than the limit of [45] characters"}

server/src/internalClusterTest/java/org/elasticsearch/cluster/ClusterHealthIT.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
import org.elasticsearch.action.support.PlainActionFuture;
1717
import org.elasticsearch.cluster.health.ClusterHealthStatus;
1818
import org.elasticsearch.cluster.metadata.IndexMetadata;
19+
import org.elasticsearch.cluster.metadata.Metadata;
1920
import org.elasticsearch.cluster.routing.UnassignedInfo;
2021
import org.elasticsearch.cluster.service.ClusterService;
2122
import org.elasticsearch.common.Priority;
@@ -56,8 +57,14 @@ public void testSimpleLocalHealth() {
5657
}
5758

5859
public void testHealth() {
60+
logger.info("--> running cluster health for '_all' on an empty cluster");
61+
ClusterHealthResponse healthResponse = clusterAdmin().prepareHealth(TEST_REQUEST_TIMEOUT, Metadata.ALL).get();
62+
assertThat(healthResponse.isTimedOut(), equalTo(false));
63+
assertThat(healthResponse.getStatus(), equalTo(ClusterHealthStatus.GREEN));
64+
assertThat(healthResponse.getIndices().isEmpty(), equalTo(true));
65+
5966
logger.info("--> running cluster health on an index that does not exists");
60-
ClusterHealthResponse healthResponse = clusterAdmin().prepareHealth(TEST_REQUEST_TIMEOUT, "test1")
67+
healthResponse = clusterAdmin().prepareHealth(TEST_REQUEST_TIMEOUT, "test1")
6168
.setWaitForYellowStatus()
6269
.setTimeout(TimeValue.timeValueSeconds(1))
6370
.get();

server/src/internalClusterTest/java/org/elasticsearch/synonyms/SynonymsManagementAPIServiceIT.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
import org.elasticsearch.action.bulk.BulkResponse;
1616
import org.elasticsearch.cluster.ClusterName;
1717
import org.elasticsearch.cluster.ClusterState;
18+
import org.elasticsearch.common.Strings;
1819
import org.elasticsearch.index.mapper.extras.MapperExtrasPlugin;
1920
import org.elasticsearch.indices.IndexCreationException;
2021
import org.elasticsearch.plugins.Plugin;
@@ -316,11 +317,7 @@ public void testCreateSynonymsWithYellowSynonymsIndex() throws Exception {
316317
@Override
317318
void checkSynonymsIndexHealth(ActionListener<ClusterHealthResponse> listener) {
318319
ClusterState clusterState = ClusterState.builder(ClusterName.DEFAULT).build();
319-
ClusterHealthResponse response = new ClusterHealthResponse(
320-
randomIdentifier(),
321-
new String[] { SynonymsManagementAPIService.SYNONYMS_INDEX_CONCRETE_NAME },
322-
clusterState
323-
);
320+
ClusterHealthResponse response = new ClusterHealthResponse(randomIdentifier(), Strings.EMPTY_ARRAY, clusterState);
324321
response.setTimedOut(true);
325322
listener.onResponse(response);
326323
}

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ static TransportVersion def(int id) {
7777
public static final TransportVersion V_8_15_0 = def(8_702_0_02);
7878
public static final TransportVersion V_8_15_2 = def(8_702_0_03);
7979
public static final TransportVersion V_8_16_0 = def(8_772_0_01);
80+
public static final TransportVersion V_8_16_1 = def(8_772_0_04);
8081
// TODO: leave this version until the very end to satisfy max transport version test
8182
public static final TransportVersion INITIAL_ELASTICSEARCH_8_17_5 = def(8_797_0_05);
8283

server/src/main/java/org/elasticsearch/action/admin/cluster/node/info/NodeInfo.java

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,11 @@ public NodeInfo(StreamInput in) throws IOException {
6666
super(in);
6767
if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_12_0)) {
6868
version = in.readString();
69-
compatibilityVersions = CompatibilityVersions.readVersion(in);
69+
if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_16_1)) {
70+
compatibilityVersions = CompatibilityVersions.readVersion(in);
71+
} else {
72+
compatibilityVersions = new CompatibilityVersions(TransportVersion.readVersion(in), Map.of()); // unknown mappings versions
73+
}
7074
indexVersion = IndexVersion.readVersion(in);
7175
} else {
7276
Version legacyVersion = Version.readVersion(in);
@@ -247,7 +251,11 @@ public void writeTo(StreamOutput out) throws IOException {
247251
} else {
248252
Version.writeVersion(Version.fromString(version), out);
249253
}
250-
compatibilityVersions.writeTo(out);
254+
if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_16_1)) {
255+
compatibilityVersions.writeTo(out);
256+
} else if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_8_0)) {
257+
TransportVersion.writeVersion(compatibilityVersions.transportVersion(), out);
258+
}
251259
if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_11_X)) {
252260
IndexVersion.writeVersion(indexVersion, out);
253261
out.writeMap(componentVersions, StreamOutput::writeString, StreamOutput::writeVInt);

0 commit comments

Comments
 (0)