Skip to content

Commit a5a3923

Browse files
committed
Merge remote-tracking branch 'origin/main' into failure-store-authentication
2 parents 64eb116 + 9782179 commit a5a3923

File tree

50 files changed

+4879
-2683
lines changed

Some content is hidden

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

50 files changed

+4879
-2683
lines changed

docs/changelog/118619.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 118619
2+
summary: Optional named arguments for function in map
3+
area: EQL
4+
type: enhancement
5+
issues: []

muted-tests.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,9 @@ tests:
244244
- class: org.elasticsearch.xpack.test.rest.XPackRestIT
245245
method: test {p0=snapshot/10_basic/Failed to snapshot indices with synthetic source}
246246
issue: https://github.com/elastic/elasticsearch/issues/120332
247+
- class: org.elasticsearch.xpack.ccr.FollowIndexSecurityIT
248+
method: testCleanShardFollowTaskAfterDeleteFollower
249+
issue: https://github.com/elastic/elasticsearch/issues/120339
247250

248251
# Examples:
249252
#

server/src/main/java/module-info.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -394,6 +394,7 @@
394394
exports org.elasticsearch.action.downsample;
395395
exports org.elasticsearch.plugins.internal
396396
to
397+
org.elasticsearch.inference,
397398
org.elasticsearch.metering,
398399
org.elasticsearch.stateless,
399400
org.elasticsearch.settings.secure,

server/src/main/java/org/elasticsearch/indices/IndicesServiceBuilder.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
import org.elasticsearch.plugins.EnginePlugin;
3535
import org.elasticsearch.plugins.IndexStorePlugin;
3636
import org.elasticsearch.plugins.PluginsService;
37-
import org.elasticsearch.plugins.SearchPlugin;
37+
import org.elasticsearch.plugins.internal.InternalSearchPlugin;
3838
import org.elasticsearch.plugins.internal.rewriter.QueryRewriteInterceptor;
3939
import org.elasticsearch.script.ScriptService;
4040
import org.elasticsearch.search.aggregations.support.ValuesSourceRegistry;
@@ -266,8 +266,8 @@ public IndicesService build() {
266266
.flatMap(m -> m.entrySet().stream())
267267
.collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue));
268268

269-
var queryRewriteInterceptors = pluginsService.filterPlugins(SearchPlugin.class)
270-
.map(SearchPlugin::getQueryRewriteInterceptors)
269+
var queryRewriteInterceptors = pluginsService.filterPlugins(InternalSearchPlugin.class)
270+
.map(InternalSearchPlugin::getQueryRewriteInterceptors)
271271
.flatMap(List::stream)
272272
.collect(Collectors.toMap(QueryRewriteInterceptor::getQueryName, interceptor -> {
273273
if (interceptor.getQueryName() == null) {

server/src/main/java/org/elasticsearch/plugins/SearchPlugin.java

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
import org.elasticsearch.index.query.QueryParser;
2424
import org.elasticsearch.index.query.functionscore.ScoreFunctionBuilder;
2525
import org.elasticsearch.index.query.functionscore.ScoreFunctionParser;
26-
import org.elasticsearch.plugins.internal.rewriter.QueryRewriteInterceptor;
2726
import org.elasticsearch.search.SearchExtBuilder;
2827
import org.elasticsearch.search.aggregations.Aggregation;
2928
import org.elasticsearch.search.aggregations.AggregationBuilder;
@@ -129,14 +128,6 @@ default List<QuerySpec<?>> getQueries() {
129128
return emptyList();
130129
}
131130

132-
/**
133-
* @return Applicable {@link QueryRewriteInterceptor}s configured for this plugin.
134-
* Note: This is internal to Elasticsearch's API and not extensible by external plugins.
135-
*/
136-
default List<QueryRewriteInterceptor> getQueryRewriteInterceptors() {
137-
return emptyList();
138-
}
139-
140131
/**
141132
* The new {@link Aggregation}s added by this plugin.
142133
*/
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
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.plugins.internal;
11+
12+
import org.elasticsearch.plugins.internal.rewriter.QueryRewriteInterceptor;
13+
14+
import java.util.List;
15+
16+
import static java.util.Collections.emptyList;
17+
18+
public interface InternalSearchPlugin {
19+
20+
/**
21+
* @return Applicable {@link QueryRewriteInterceptor}s configured for this plugin.
22+
* Note: This is internal to Elasticsearch's API and not extensible by external plugins.
23+
*/
24+
default List<QueryRewriteInterceptor> getQueryRewriteInterceptors() {
25+
return emptyList();
26+
}
27+
}

x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/enrich/EnrichPolicy.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
*/
3636
public final class EnrichPolicy implements Writeable, ToXContentFragment {
3737

38-
private static final String ELASTICEARCH_VERSION_DEPRECATION_MESSAGE =
38+
private static final String ELASTICSEARCH_VERSION_DEPRECATION_MESSAGE =
3939
"the [elasticsearch_version] field of an enrich policy has no effect and will be removed in a future version of Elasticsearch";
4040

4141
private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(EnrichPolicy.class);
@@ -146,7 +146,7 @@ private EnrichPolicy(
146146
deprecationLogger.warn(
147147
DeprecationCategory.OTHER,
148148
"enrich_policy_with_elasticsearch_version",
149-
ELASTICEARCH_VERSION_DEPRECATION_MESSAGE
149+
ELASTICSEARCH_VERSION_DEPRECATION_MESSAGE
150150
);
151151
}
152152
}

x-pack/plugin/enrich/src/main/java/org/elasticsearch/xpack/enrich/AbstractEnrichProcessor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ public void execute(IngestDocument ingestDocument, BiConsumer<IngestDocument, Ex
9090
// If the index is empty, return the unchanged document
9191
// If the enrich key does not exist in the index, throw an error
9292
// If no documents match the key, return the unchanged document
93-
if (searchHits.size() < 1) {
93+
if (searchHits.isEmpty()) {
9494
handler.accept(ingestDocument, null);
9595
return;
9696
}

x-pack/plugin/enrich/src/main/java/org/elasticsearch/xpack/enrich/EnrichCache.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,12 @@
3535
/**
3636
* A simple cache for enrich that uses {@link Cache}. There is one instance of this cache and
3737
* multiple enrich processors with different policies will use this cache.
38-
*
38+
* <p>
3939
* The key of the cache is based on the search request and the enrich index that will be used.
4040
* Search requests that enrich generates target the alias for an enrich policy, this class
4141
* resolves the alias to the actual enrich index and uses that for the cache key. This way
4242
* no stale entries will be returned if a policy execution happens and a new enrich index is created.
43-
*
43+
* <p>
4444
* There is no cleanup mechanism of stale entries in case a new enrich index is created
4545
* as part of a policy execution. This shouldn't be needed as cache entries for prior enrich
4646
* indices will be eventually evicted, because these entries will not end up being used. The

x-pack/plugin/enrich/src/main/java/org/elasticsearch/xpack/enrich/GeoMatchProcessor.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public final class GeoMatchProcessor extends AbstractEnrichProcessor {
4040
) {
4141
super(tag, description, searchRunner, policyName, field, targetField, ignoreMissing, overrideEnabled, matchField, maxMatches);
4242
this.shapeRelation = shapeRelation;
43-
parser = new GeometryParser(orientation.getAsBoolean(), true, true);
43+
this.parser = new GeometryParser(orientation.getAsBoolean(), true, true);
4444
}
4545

4646
@Override
@@ -50,8 +50,4 @@ public QueryBuilder getQueryBuilder(Object fieldValue) {
5050
shapeQuery.relation(shapeRelation);
5151
return shapeQuery;
5252
}
53-
54-
public ShapeRelation getShapeRelation() {
55-
return shapeRelation;
56-
}
5753
}

0 commit comments

Comments
 (0)