Skip to content

Commit 09c83a8

Browse files
committed
Merge branch 'main' into failures-lifecycle-config
2 parents 197e323 + c4cba5a commit 09c83a8

File tree

82 files changed

+1304
-376
lines changed

Some content is hidden

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

82 files changed

+1304
-376
lines changed

distribution/docker/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -590,7 +590,7 @@ for (final Architecture architecture : Architecture.values()) {
590590
}
591591
if(base == DockerBase.DEFAULT) {
592592
// Add additional docker hub specific context which we use solely for publishing to docker hub.
593-
// At the moment it only differs in not labels added that we need for openshift certification
593+
// At the moment it is exactly the same as the default context.
594594
addBuildDockerContextTask(architecture, base, 'DockerHubContext', "docker-hub-build-context")
595595
}
596596
}

distribution/docker/src/docker/Dockerfile.default

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,15 +139,13 @@ LABEL org.label-schema.build-date="${build_date}" \\
139139
org.opencontainers.image.vendor="Elastic" \\
140140
org.opencontainers.image.version="${version}"
141141

142-
<% if (docker_context != 'docker-hub-build-context') { %>
143142
LABEL name="Elasticsearch" \\
144143
maintainer="[email protected]" \\
145144
vendor="Elastic" \\
146145
version="${version}" \\
147146
release="1" \\
148147
summary="Elasticsearch" \\
149148
description="You know, for search."
150-
<% } %>
151149

152150
RUN mkdir /licenses && ln LICENSE.txt /licenses/LICENSE
153151

docs/reference/elasticsearch/index-settings/index-modules.md

Lines changed: 21 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -49,39 +49,27 @@ $$$index-codec$$$ `index.codec`
4949

5050
$$$index-mode-setting$$$ `index.mode`
5151
: The `index.mode` setting is used to control settings applied in specific domains like ingestion of time series data or logs. Different mutually exclusive modes exist, which are used to apply settings or default values controlling indexing of documents, sorting and other parameters whose value affects indexing or query performance.
52-
53-
```console
54-
PUT my-index-000001
55-
{
56-
"settings": {
57-
"index":{
58-
"mode":"standard" <1>
59-
}
60-
}
61-
}
62-
```
63-
64-
1. This index uses the `standard` index mode
65-
66-
67-
Index mode supports the following values:
68-
69-
`null`
70-
: Default value (same as `standard`).
71-
72-
`standard`
73-
: Standard indexing with default settings.
74-
75-
`lookup`
76-
: Index that can be used for lookup joins in ES|QL. Limited to 1 shard.
77-
78-
79-
`time_series`
80-
: *(data streams only)* Index mode optimized for storage of metrics. For more information, see [Time series index settings](time-series.md).
81-
82-
`logsdb`
83-
: *(data streams only)* Index mode optimized for [logs](docs-content://manage-data/data-store/data-streams/logs-data-stream.md).
84-
52+
53+
**Example**
54+
55+
```console
56+
PUT my-index-000001
57+
{
58+
"settings": {
59+
"index":{
60+
"mode":"standard" # This index uses the `standard` index mode
61+
}
62+
}
63+
}
64+
```
65+
**Supported values**
66+
67+
The `index.mode` setting supports the following values:
68+
- `null`: Default value (same as `standard`).
69+
- `standard`: Standard indexing with default settings.
70+
- `lookup`: Index that can be used for [LOOKUP JOIN](/reference/query-languages/esql/esql-lookup-join.md) in ES|QL. Limited to 1 shard.
71+
- `time_series`: *(data streams only)* Index mode optimized for storage of metrics. For more information, see [Time series index settings](time-series.md).
72+
- `logsdb`: *(data streams only)* Index mode optimized for [logs](docs-content://manage-data/data-store/data-streams/logs-data-stream.md).
8573

8674
$$$routing-partition-size$$$ `index.routing_partition_size`
8775
: The number of shards a custom routing value can go to. Defaults to 1 and can only be set at index creation time. This value must be less than the `index.number_of_routing_shards` unless the `index.number_of_routing_shards` value is also 1. for more details about how this setting is used, refer to [](/reference/elasticsearch/mapping-reference/mapping-routing-field.md#routing-index-partition).

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -247,9 +247,10 @@ is not supported for querying the field data.
247247

248248
## Updates to `semantic_text` fields [update-script]
249249

250-
Updates that use scripts are not supported for an index contains a
251-
`semantic_text` field. Even if the script targets non-`semantic_text` fields,
252-
the update will fail when the index contains a `semantic_text` field.
250+
For indices containing `semantic_text` fields, updates that use scripts have the following behavior:
251+
252+
* Are supported through the [Update API](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-update).
253+
* Are not supported through the [Bulk API](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-bulk-1) and will fail. Even if the script targets non-`semantic_text` fields, the update will fail when the index contains a `semantic_text` field.
253254

254255
## `copy_to` and multi-fields support [copy-to-support]
255256

@@ -311,4 +312,4 @@ PUT test-index
311312
of [nested fields](/reference/elasticsearch/mapping-reference/nested.md).
312313
* `semantic_text` fields can’t currently be set as part
313314
of [Dynamic templates](docs-content://manage-data/data-store/mapping/dynamic-templates.md).
314-
315+
* `semantic_text` fields are not supported with Cross-Cluster Search (CCS) or Cross-Cluster Replication (CCR).

docs/reference/query-languages/esql/esql-lookup-join.md

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -122,21 +122,19 @@ FROM firewall_logs # The source index
122122
| LOOKUP JOIN threat_list ON source.ip # The lookup index and join field
123123
| WHERE threat_level IS NOT NULL # Filter for rows non-null threat levels
124124
| SORT timestamp # LOOKUP JOIN does not guarantee output order, so you must explicitly sort the results if needed
125-
| KEEP timestamp, source.ip, destination.ip, action, threat_level, threat_type # Keep only relevant fields
125+
| KEEP source.ip, action, threat_type, threat_level # Keep only relevant fields
126126
| LIMIT 10 # Limit the output to 10 rows
127127
```
128128

129129
### Response
130130

131131
A successful query will output a table. In this example, you can see that the `source.ip` field from the `firewall_logs` index is matched with the `source.ip` field in the `threat_list` index, and the corresponding `threat_level` and `threat_type` fields are added to the output.
132132

133-
```
134-
source.ip | action | threat_type | threat_level
135-
---------------+---------------+---------------+---------------
136-
203.0.113.5 |allow |C2_SERVER |high
137-
198.51.100.2 |block |SCANNER |medium
138-
203.0.113.5 |allow |C2_SERVER |high
139-
```
133+
|source.ip|action|threat_type|threat_level|
134+
|---|---|---|---|
135+
|203.0.113.5|allow|C2_SERVER|high|
136+
|198.51.100.2|block|SCANNER|medium|
137+
|203.0.113.5|allow|C2_SERVER|high|
140138

141139
### Additional examples
142140

libs/entitlement/src/main/java/org/elasticsearch/entitlement/initialization/EntitlementInitialization.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,10 @@ private static PolicyManager createPolicyManager() {
279279
new FilesEntitlement(List.of(FileData.ofBaseDirPath(CONFIG, READ), FileData.ofBaseDirPath(DATA, READ_WRITE)))
280280
)
281281
),
282-
new Scope("org.apache.lucene.misc", List.of(new FilesEntitlement(List.of(FileData.ofBaseDirPath(DATA, READ_WRITE))))),
282+
new Scope(
283+
"org.apache.lucene.misc",
284+
List.of(new FilesEntitlement(List.of(FileData.ofBaseDirPath(DATA, READ_WRITE))), new ReadStoreAttributesEntitlement())
285+
),
283286
new Scope(
284287
"org.apache.logging.log4j.core",
285288
List.of(new ManageThreadsEntitlement(), new FilesEntitlement(List.of(FileData.ofBaseDirPath(LOGS, READ_WRITE))))

server/src/main/java/org/elasticsearch/cluster/project/ProjectResolver.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import org.elasticsearch.cluster.metadata.ProjectId;
2222
import org.elasticsearch.cluster.metadata.ProjectMetadata;
2323
import org.elasticsearch.core.CheckedRunnable;
24+
import org.elasticsearch.core.FixForMultiProject;
2425

2526
import java.util.Collection;
2627
import java.util.Objects;
@@ -94,6 +95,7 @@ default Collection<ProjectId> getProjectIds(ClusterState clusterState) {
9495
/**
9596
* Returns a client that executes every request in the context of the given project.
9697
*/
98+
@FixForMultiProject(description = "This recreates a client on every invocation. We should optimize this to be less wasteful")
9799
default Client projectClient(Client baseClient, ProjectId projectId) {
98100
// We only take the shortcut when the given project ID matches the "current" project ID. If it doesn't, we'll let #executeOnProject
99101
// take care of error handling.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/*
2+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3+
* or more contributor license agreements. Licensed under the "Elastic License
4+
* 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side
5+
* Public License v 1"; you may not use this file except in compliance with, at
6+
* your election, the "Elastic License 2.0", the "GNU Affero General Public
7+
* License v3.0 only", or the "Server Side Public License, v 1".
8+
*/
9+
10+
package org.elasticsearch.index.codec.vectors.es818;
11+
12+
import org.apache.lucene.store.IOContext;
13+
import org.apache.lucene.store.IndexInput;
14+
15+
import java.io.IOException;
16+
17+
/**
18+
* A hook for {@link DirectIOLucene99FlatVectorsReader} to specify the input should be opened using DirectIO.
19+
* Remove when IOContext allows more extensible payloads to be specified.
20+
*/
21+
public interface DirectIOIndexInputSupplier {
22+
IndexInput openInputDirect(String name, IOContext context) throws IOException;
23+
}
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
/*
2+
* @notice
3+
* Licensed to the Apache Software Foundation (ASF) under one or more
4+
* contributor license agreements. See the NOTICE file distributed with
5+
* this work for additional information regarding copyright ownership.
6+
* The ASF licenses this file to You under the Apache License, Version 2.0
7+
* (the "License"); you may not use this file except in compliance with
8+
* the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*
18+
* Modifications copyright (C) 2024 Elasticsearch B.V.
19+
*/
20+
package org.elasticsearch.index.codec.vectors.es818;
21+
22+
import org.apache.lucene.codecs.hnsw.FlatVectorsFormat;
23+
import org.apache.lucene.codecs.hnsw.FlatVectorsReader;
24+
import org.apache.lucene.codecs.hnsw.FlatVectorsScorer;
25+
import org.apache.lucene.codecs.hnsw.FlatVectorsWriter;
26+
import org.apache.lucene.codecs.lucene99.Lucene99FlatVectorsWriter;
27+
import org.apache.lucene.index.SegmentReadState;
28+
import org.apache.lucene.index.SegmentWriteState;
29+
30+
import java.io.IOException;
31+
32+
/**
33+
* Copied from Lucene99FlatVectorsFormat in Lucene 10.1
34+
*
35+
* This is copied to change the implementation of {@link #fieldsReader} only.
36+
* The codec format itself is not changed, so we keep the original {@link #NAME}
37+
*/
38+
public class DirectIOLucene99FlatVectorsFormat extends FlatVectorsFormat {
39+
40+
static final String NAME = "Lucene99FlatVectorsFormat";
41+
static final String META_CODEC_NAME = "Lucene99FlatVectorsFormatMeta";
42+
static final String VECTOR_DATA_CODEC_NAME = "Lucene99FlatVectorsFormatData";
43+
static final String META_EXTENSION = "vemf";
44+
static final String VECTOR_DATA_EXTENSION = "vec";
45+
46+
public static final int VERSION_START = 0;
47+
public static final int VERSION_CURRENT = VERSION_START;
48+
49+
static final int DIRECT_MONOTONIC_BLOCK_SHIFT = 16;
50+
private final FlatVectorsScorer vectorsScorer;
51+
52+
/** Constructs a format */
53+
public DirectIOLucene99FlatVectorsFormat(FlatVectorsScorer vectorsScorer) {
54+
super(NAME);
55+
this.vectorsScorer = vectorsScorer;
56+
}
57+
58+
@Override
59+
public FlatVectorsWriter fieldsWriter(SegmentWriteState state) throws IOException {
60+
return new Lucene99FlatVectorsWriter(state, vectorsScorer);
61+
}
62+
63+
@Override
64+
public FlatVectorsReader fieldsReader(SegmentReadState state) throws IOException {
65+
return new DirectIOLucene99FlatVectorsReader(state, vectorsScorer);
66+
}
67+
68+
@Override
69+
public String toString() {
70+
return "ES818FlatVectorsFormat(" + "vectorsScorer=" + vectorsScorer + ')';
71+
}
72+
}

0 commit comments

Comments
 (0)