Skip to content

Commit bea45e3

Browse files
authored
Merge branch 'main' into partial-result-on-demand
2 parents 94e4e07 + 22c0264 commit bea45e3

File tree

54 files changed

+988
-333
lines changed

Some content is hidden

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

54 files changed

+988
-333
lines changed

docs/changelog/120128.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 120128
2+
summary: Add Multi-Field Support for Semantic Text Fields
3+
area: Relevance
4+
type: feature
5+
issues: []

docs/changelog/120445.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 120445
2+
summary: Run `GetPipelineTransportAction` on local node
3+
area: Ingest Node
4+
type: enhancement
5+
issues: []

docs/changelog/120548.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 120548
2+
summary: Add `remove_index_block` arg to `_create_from` api
3+
area: Indices APIs
4+
type: enhancement
5+
issues: []

docs/reference/mapping/types/semantic-text.asciidoc

Lines changed: 26 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -182,16 +182,11 @@ Even if the script targets non-`semantic_text` fields, the update will fail when
182182

183183
[discrete]
184184
[[copy-to-support]]
185-
==== `copy_to` support
185+
==== `copy_to` and multi-fields support
186186

187-
The `semantic_text` field type can be the target of
188-
<<copy-to,`copy_to` fields>>. This means you can use a single `semantic_text`
189-
field to collect the values of other fields for semantic search. Each value has
190-
its embeddings calculated separately; each field value is a separate set of chunk(s) in
191-
the resulting embeddings.
192-
193-
This imposes a restriction on bulk requests and ingestion pipelines that update documents with `semantic_text` fields.
194-
In these cases, all fields that are copied to a `semantic_text` field, including the `semantic_text` field value, must have a value to ensure every embedding is calculated correctly.
187+
The semantic_text field type can serve as the target of <<copy-to,copy_to fields>>,
188+
be part of a <<multi-fields,multi-field>> structure, or contain <<multi-fields,multi-fields>> internally.
189+
This means you can use a single field to collect the values of other fields for semantic search.
195190

196191
For example, the following mapping:
197192

@@ -201,39 +196,48 @@ PUT test-index
201196
{
202197
"mappings": {
203198
"properties": {
204-
"infer_field": {
205-
"type": "semantic_text",
206-
"inference_id": ".elser-2-elasticsearch"
207-
},
208199
"source_field": {
209200
"type": "text",
210201
"copy_to": "infer_field"
202+
},
203+
"infer_field": {
204+
"type": "semantic_text",
205+
"inference_id": ".elser-2-elasticsearch"
211206
}
212207
}
213208
}
214209
}
215210
------------------------------------------------------------
216211
// TEST[skip:TBD]
217212

218-
Will need the following bulk update request to ensure that `infer_field` is updated correctly:
213+
can also be declared as multi-fields:
219214

220215
[source,console]
221216
------------------------------------------------------------
222-
PUT test-index/_bulk
223-
{"update": {"_id": "1"}}
224-
{"doc": {"infer_field": "updated inference field", "source_field": "updated source field"}}
217+
PUT test-index
218+
{
219+
"mappings": {
220+
"properties": {
221+
"source_field": {
222+
"type": "text",
223+
"fields": {
224+
"infer_field": {
225+
"type": "semantic_text",
226+
"inference_id": ".elser-2-elasticsearch"
227+
}
228+
}
229+
}
230+
}
231+
}
232+
}
225233
------------------------------------------------------------
226234
// TEST[skip:TBD]
227235

228-
Notice that both the `semantic_text` field and the source field are updated in the bulk request.
229-
230-
231236
[discrete]
232237
[[limitations]]
233238
==== Limitations
234239

235240
`semantic_text` field types have the following limitations:
236241

237242
* `semantic_text` fields are not currently supported as elements of <<nested,nested fields>>.
238-
* `semantic_text` fields can't currently be set as part of <<dynamic-templates>>.
239-
* `semantic_text` fields can't be defined as <<multi-fields,multi-fields>> of another field, nor can they contain other fields as multi-fields.
243+
* `semantic_text` fields can't currently be set as part of <<dynamic-templates>>.

muted-tests.yml

Lines changed: 16 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -52,21 +52,9 @@ tests:
5252
- class: org.elasticsearch.xpack.transform.integration.TransformIT
5353
method: testStopWaitForCheckpoint
5454
issue: https://github.com/elastic/elasticsearch/issues/106113
55-
- class: org.elasticsearch.xpack.inference.TextEmbeddingCrudIT
56-
method: testPutE5Small_withPlatformAgnosticVariant
57-
issue: https://github.com/elastic/elasticsearch/issues/113983
58-
- class: org.elasticsearch.xpack.inference.TextEmbeddingCrudIT
59-
method: testPutE5WithTrainedModelAndInference
60-
issue: https://github.com/elastic/elasticsearch/issues/114023
61-
- class: org.elasticsearch.xpack.inference.TextEmbeddingCrudIT
62-
method: testPutE5Small_withPlatformSpecificVariant
63-
issue: https://github.com/elastic/elasticsearch/issues/113950
6455
- class: org.elasticsearch.xpack.remotecluster.RemoteClusterSecurityWithApmTracingRestIT
6556
method: testTracingCrossCluster
6657
issue: https://github.com/elastic/elasticsearch/issues/112731
67-
- class: org.elasticsearch.xpack.inference.DefaultEndPointsIT
68-
method: testInferDeploysDefaultE5
69-
issue: https://github.com/elastic/elasticsearch/issues/115361
7058
- class: org.elasticsearch.xpack.restart.MLModelDeploymentFullClusterRestartIT
7159
method: testDeploymentSurvivesRestart {cluster=UPGRADED}
7260
issue: https://github.com/elastic/elasticsearch/issues/115528
@@ -110,9 +98,6 @@ tests:
11098
- class: org.elasticsearch.xpack.apmdata.APMYamlTestSuiteIT
11199
method: test {yaml=/10_apm/Test template reinstallation}
112100
issue: https://github.com/elastic/elasticsearch/issues/116445
113-
- class: org.elasticsearch.xpack.inference.DefaultEndPointsIT
114-
method: testMultipleInferencesTriggeringDownloadAndDeploy
115-
issue: https://github.com/elastic/elasticsearch/issues/117208
116101
- class: org.elasticsearch.ingest.geoip.EnterpriseGeoIpDownloaderIT
117102
method: testEnterpriseDownloaderTask
118103
issue: https://github.com/elastic/elasticsearch/issues/115163
@@ -125,9 +110,6 @@ tests:
125110
- class: org.elasticsearch.xpack.test.rest.XPackRestIT
126111
method: test {p0=snapshot/10_basic/Create a source only snapshot and then restore it}
127112
issue: https://github.com/elastic/elasticsearch/issues/117295
128-
- class: org.elasticsearch.xpack.inference.DefaultEndPointsIT
129-
method: testInferDeploysDefaultElser
130-
issue: https://github.com/elastic/elasticsearch/issues/114913
131113
- class: org.elasticsearch.xpack.inference.InferenceRestIT
132114
method: test {p0=inference/40_semantic_text_query/Query a field that uses the default ELSER 2 endpoint}
133115
issue: https://github.com/elastic/elasticsearch/issues/117027
@@ -152,9 +134,6 @@ tests:
152134
- class: org.elasticsearch.xpack.remotecluster.CrossClusterEsqlRCS2UnavailableRemotesIT
153135
method: testEsqlRcs2UnavailableRemoteScenarios
154136
issue: https://github.com/elastic/elasticsearch/issues/117419
155-
- class: org.elasticsearch.xpack.inference.DefaultEndPointsIT
156-
method: testInferDeploysDefaultRerank
157-
issue: https://github.com/elastic/elasticsearch/issues/118184
158137
- class: org.elasticsearch.xpack.esql.action.EsqlActionTaskIT
159138
method: testCancelRequestWhenFailingFetchingPages
160139
issue: https://github.com/elastic/elasticsearch/issues/118193
@@ -251,6 +230,22 @@ tests:
251230
issue: https://github.com/elastic/elasticsearch/issues/120482
252231
- class: org.elasticsearch.smoketest.DocsClientYamlTestSuiteIT
253232
issue: https://github.com/elastic/elasticsearch/issues/120497
233+
- class: org.elasticsearch.xpack.sql.expression.function.scalar.datetime.DateTimeToCharProcessorTests
234+
issue: https://github.com/elastic/elasticsearch/issues/120575
235+
- class: org.elasticsearch.discovery.ec2.DiscoveryEc2KeystoreCredentialsIT
236+
issue: https://github.com/elastic/elasticsearch/issues/120576
237+
- class: org.elasticsearch.discovery.ec2.DiscoveryEc2KeystoreSessionCredentialsIT
238+
issue: https://github.com/elastic/elasticsearch/issues/120577
239+
- class: org.elasticsearch.discovery.ec2.DiscoveryEc2SystemPropertyCredentialsIT
240+
issue: https://github.com/elastic/elasticsearch/issues/120578
241+
- class: org.elasticsearch.discovery.ec2.DiscoveryEc2EnvironmentVariableCredentialsIT
242+
issue: https://github.com/elastic/elasticsearch/issues/120579
243+
- class: org.elasticsearch.action.search.SearchProgressActionListenerIT
244+
method: testSearchProgressWithHitsAndAggs
245+
issue: https://github.com/elastic/elasticsearch/issues/120583
246+
- class: org.elasticsearch.xpack.esql.heap_attack.HeapAttackIT
247+
method: testEnrichExplosionManyMatches
248+
issue: https://github.com/elastic/elasticsearch/issues/120587
254249

255250
# Examples:
256251
#

qa/smoke-test-http/src/javaRestTest/java/org/elasticsearch/http/RestActionCancellationIT.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import org.elasticsearch.action.admin.indices.template.get.GetIndexTemplatesAction;
2222
import org.elasticsearch.action.admin.indices.template.post.SimulateIndexTemplateAction;
2323
import org.elasticsearch.action.admin.indices.template.post.SimulateTemplateAction;
24+
import org.elasticsearch.action.ingest.GetPipelineAction;
2425
import org.elasticsearch.action.support.CancellableActionTestPlugin;
2526
import org.elasticsearch.action.support.PlainActionFuture;
2627
import org.elasticsearch.action.support.RefCountingListener;
@@ -103,6 +104,10 @@ public void testClusterGetSettingsCancellation() {
103104
runRestActionCancellationTest(new Request(HttpGet.METHOD_NAME, "/_cluster/settings"), ClusterGetSettingsAction.NAME);
104105
}
105106

107+
public void testGetPipelineCancellation() {
108+
runRestActionCancellationTest(new Request(HttpGet.METHOD_NAME, "/_ingest/pipeline"), GetPipelineAction.NAME);
109+
}
110+
106111
private void runRestActionCancellationTest(Request request, String actionName) {
107112
final var node = usually() ? internalCluster().getRandomNodeName() : internalCluster().startCoordinatingOnlyNode(Settings.EMPTY);
108113

rest-api-spec/src/main/resources/rest-api-spec/api/migrate.create_from.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
]
3030
},
3131
"body":{
32-
"description":"The body contains the fields `mappings_override` and `settings_override`.",
32+
"description":"The body contains the fields `mappings_override`, `settings_override`, and `remove_index_blocks`.",
3333
"required":false
3434
}
3535
}

server/src/internalClusterTest/java/org/elasticsearch/indices/cluster/ShardLockFailureIT.java

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,14 @@ public void testShardLockFailure() throws Exception {
7272
var ignored1 = internalCluster().getInstance(NodeEnvironment.class, node).shardLock(shardId, "blocked for test");
7373
var mockLog = MockLog.capture(IndicesClusterStateService.class);
7474
) {
75-
75+
mockLog.addExpectation(
76+
new MockLog.SeenEventExpectation(
77+
"hot threads",
78+
"org.elasticsearch.indices.cluster.IndicesClusterStateService",
79+
Level.WARN,
80+
"[testindex][0]: acquire shard lock for create"
81+
)
82+
);
7683
mockLog.addExpectation(new MockLog.LoggingExpectation() {
7784
private final CountDownLatch countDownLatch = new CountDownLatch(1);
7885
int debugMessagesSeen = 0;
@@ -147,6 +154,14 @@ public void testShardLockTimeout() throws Exception {
147154
var ignored1 = internalCluster().getInstance(NodeEnvironment.class, node).shardLock(shardId, "blocked for test");
148155
var mockLog = MockLog.capture(IndicesClusterStateService.class);
149156
) {
157+
mockLog.addExpectation(
158+
new MockLog.SeenEventExpectation(
159+
"hot threads",
160+
"org.elasticsearch.indices.cluster.IndicesClusterStateService",
161+
Level.WARN,
162+
"[testindex][0]: acquire shard lock for create"
163+
)
164+
);
150165
mockLog.addExpectation(
151166
new MockLog.SeenEventExpectation(
152167
"timeout message",

server/src/main/java/org/elasticsearch/action/ingest/GetPipelineRequest.java

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,18 @@
1010
package org.elasticsearch.action.ingest;
1111

1212
import org.elasticsearch.action.ActionRequestValidationException;
13-
import org.elasticsearch.action.support.master.MasterNodeReadRequest;
13+
import org.elasticsearch.action.support.local.LocalClusterStateRequest;
1414
import org.elasticsearch.common.io.stream.StreamInput;
15-
import org.elasticsearch.common.io.stream.StreamOutput;
1615
import org.elasticsearch.core.TimeValue;
16+
import org.elasticsearch.core.UpdateForV10;
17+
import org.elasticsearch.tasks.CancellableTask;
18+
import org.elasticsearch.tasks.Task;
19+
import org.elasticsearch.tasks.TaskId;
1720

1821
import java.io.IOException;
22+
import java.util.Map;
1923

20-
public class GetPipelineRequest extends MasterNodeReadRequest<GetPipelineRequest> {
24+
public class GetPipelineRequest extends LocalClusterStateRequest {
2125

2226
private final String[] ids;
2327
private final boolean summary;
@@ -35,19 +39,17 @@ public GetPipelineRequest(TimeValue masterNodeTimeout, String... ids) {
3539
this(masterNodeTimeout, false, ids);
3640
}
3741

42+
/**
43+
* NB prior to 9.0 this was a TransportMasterNodeReadAction so for BwC we must remain able to read these requests until
44+
* we no longer need to support calling this action remotely.
45+
*/
46+
@UpdateForV10(owner = UpdateForV10.Owner.DATA_MANAGEMENT)
3847
public GetPipelineRequest(StreamInput in) throws IOException {
3948
super(in);
4049
ids = in.readStringArray();
4150
summary = in.readBoolean();
4251
}
4352

44-
@Override
45-
public void writeTo(StreamOutput out) throws IOException {
46-
super.writeTo(out);
47-
out.writeStringArray(ids);
48-
out.writeBoolean(summary);
49-
}
50-
5153
public String[] getIds() {
5254
return ids;
5355
}
@@ -60,4 +62,9 @@ public boolean isSummary() {
6062
public ActionRequestValidationException validate() {
6163
return null;
6264
}
65+
66+
@Override
67+
public Task createTask(long id, String type, String action, TaskId parentTaskId, Map<String, String> headers) {
68+
return new CancellableTask(id, type, action, "", parentTaskId, headers);
69+
}
6370
}

server/src/main/java/org/elasticsearch/action/ingest/GetPipelineResponse.java

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,14 @@
1111

1212
import org.elasticsearch.action.ActionResponse;
1313
import org.elasticsearch.common.Strings;
14-
import org.elasticsearch.common.io.stream.StreamInput;
1514
import org.elasticsearch.common.io.stream.StreamOutput;
15+
import org.elasticsearch.core.UpdateForV10;
1616
import org.elasticsearch.ingest.PipelineConfiguration;
1717
import org.elasticsearch.rest.RestStatus;
1818
import org.elasticsearch.xcontent.ToXContentObject;
1919
import org.elasticsearch.xcontent.XContentBuilder;
2020

2121
import java.io.IOException;
22-
import java.util.ArrayList;
2322
import java.util.Collections;
2423
import java.util.HashMap;
2524
import java.util.List;
@@ -30,16 +29,6 @@ public class GetPipelineResponse extends ActionResponse implements ToXContentObj
3029
private final List<PipelineConfiguration> pipelines;
3130
private final boolean summary;
3231

33-
public GetPipelineResponse(StreamInput in) throws IOException {
34-
super(in);
35-
int size = in.readVInt();
36-
pipelines = new ArrayList<>(size);
37-
for (int i = 0; i < size; i++) {
38-
pipelines.add(PipelineConfiguration.readFrom(in));
39-
}
40-
summary = in.readBoolean();
41-
}
42-
4332
public GetPipelineResponse(List<PipelineConfiguration> pipelines, boolean summary) {
4433
this.pipelines = pipelines;
4534
this.summary = summary;
@@ -58,6 +47,11 @@ public List<PipelineConfiguration> pipelines() {
5847
return Collections.unmodifiableList(pipelines);
5948
}
6049

50+
/**
51+
* NB prior to 9.0 this was a TransportMasterNodeReadAction so for BwC we must remain able to read these requests until
52+
* we no longer need to support calling this action remotely.
53+
*/
54+
@UpdateForV10(owner = UpdateForV10.Owner.DATA_MANAGEMENT)
6155
@Override
6256
public void writeTo(StreamOutput out) throws IOException {
6357
out.writeCollection(pipelines);

0 commit comments

Comments
 (0)