Skip to content

Commit 76b0767

Browse files
committed
Merge remote-tracking branch 'elastic/main' into add-window-to-aggregate-function
2 parents c06417d + ac0bc48 commit 76b0767

File tree

15 files changed

+271
-34
lines changed

15 files changed

+271
-34
lines changed

docs/reference/elasticsearch/rest-apis/retrievers/retrievers-examples.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,10 @@ This returns the following response based on the final rrf score for each result
199199
::::
200200

201201

202-
### Using the expanded format with weights {applies_to}`stack: ga 9.2`
202+
### Using the expanded format with weights
203+
```{applies_to}
204+
stack: ga 9.2
205+
```
203206

204207
The same query can be written using the expanded format, which allows you to specify custom weights to adjust the influence of each retriever on the final ranking.
205208
In this example, we're giving the `standard` retriever twice the influence of the `knn` retriever:

muted-tests.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -507,6 +507,12 @@ tests:
507507
- class: org.elasticsearch.xpack.ilm.TimeSeriesDataStreamsIT
508508
method: testSearchableSnapshotAction
509509
issue: https://github.com/elastic/elasticsearch/issues/137167
510+
- class: org.elasticsearch.xpack.security.CoreWithSecurityClientYamlTestSuiteIT
511+
method: test {yaml=indices.validate_query/20_query_string/validate_query with query_string parameters}
512+
issue: https://github.com/elastic/elasticsearch/issues/137391
513+
- class: org.elasticsearch.xpack.downsample.ILMDownsampleDisruptionIT
514+
method: testILMDownsampleRollingRestart
515+
issue: https://github.com/elastic/elasticsearch/issues/136585
510516

511517
# Examples:
512518
#

server/src/main/java/org/elasticsearch/action/search/SearchRequest.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,11 @@ public boolean allowsRemoteIndices() {
163163
return true;
164164
}
165165

166+
@Override
167+
public boolean allowsCrossProject() {
168+
return true;
169+
}
170+
166171
/**
167172
* Creates a new sub-search request starting from the original search request that is provided.
168173
* For internal use only, allows to fork a search request into multiple search requests that will be executed independently.

server/src/main/java/org/elasticsearch/action/search/SearchResponse.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -609,13 +609,18 @@ public Clusters(StreamInput in) throws IOException {
609609
}
610610

611611
public Clusters(Map<String, Cluster> clusterInfoMap) {
612+
this(clusterInfoMap, true);
613+
}
614+
615+
public Clusters(Map<String, Cluster> clusterInfoMap, boolean ccsMinimizeRoundtrips) {
612616
assert clusterInfoMap.size() > 0 : "this constructor should not be called with an empty Cluster info map";
613617
this.total = clusterInfoMap.size();
614-
this.clusterInfo = clusterInfoMap;
618+
this.clusterInfo = ConcurrentCollections.newConcurrentMap();
619+
this.clusterInfo.putAll(clusterInfoMap);
615620
this.successful = getClusterStateCount(Cluster.Status.SUCCESSFUL);
616621
this.skipped = getClusterStateCount(Cluster.Status.SKIPPED);
617622
// should only be called if "details" section of fromXContent is present (for ccsMinimizeRoundtrips)
618-
this.ccsMinimizeRoundtrips = true;
623+
this.ccsMinimizeRoundtrips = ccsMinimizeRoundtrips;
619624
}
620625

621626
@Override

server/src/main/java/org/elasticsearch/action/search/SearchShardsRequest.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
import org.elasticsearch.action.ActionRequestValidationException;
1313
import org.elasticsearch.action.IndicesRequest;
1414
import org.elasticsearch.action.LegacyActionRequest;
15+
import org.elasticsearch.action.ResolvedIndexExpressions;
1516
import org.elasticsearch.action.support.IndicesOptions;
1617
import org.elasticsearch.common.io.stream.StreamInput;
1718
import org.elasticsearch.common.io.stream.StreamOutput;
@@ -43,6 +44,8 @@ public final class SearchShardsRequest extends LegacyActionRequest implements In
4344

4445
private final String clusterAlias;
4546

47+
private ResolvedIndexExpressions resolvedIndexExpressions;
48+
4649
public SearchShardsRequest(
4750
String[] indices,
4851
IndicesOptions indicesOptions,
@@ -179,4 +182,14 @@ public int hashCode() {
179182
result = 31 * result + Arrays.hashCode(indices);
180183
return result;
181184
}
185+
186+
@Override
187+
public void setResolvedIndexExpressions(ResolvedIndexExpressions expressions) {
188+
this.resolvedIndexExpressions = expressions;
189+
}
190+
191+
@Override
192+
public ResolvedIndexExpressions getResolvedIndexExpressions() {
193+
return resolvedIndexExpressions;
194+
}
182195
}

server/src/main/java/org/elasticsearch/action/search/SearchShardsResponse.java

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,16 @@
99

1010
package org.elasticsearch.action.search;
1111

12+
import org.elasticsearch.TransportVersion;
1213
import org.elasticsearch.action.ActionResponse;
14+
import org.elasticsearch.action.ResolvedIndexExpressions;
1315
import org.elasticsearch.action.admin.cluster.shards.ClusterSearchShardsGroup;
1416
import org.elasticsearch.action.admin.cluster.shards.ClusterSearchShardsResponse;
1517
import org.elasticsearch.cluster.node.DiscoveryNode;
1618
import org.elasticsearch.common.io.stream.StreamInput;
1719
import org.elasticsearch.common.io.stream.StreamOutput;
1820
import org.elasticsearch.common.util.Maps;
21+
import org.elasticsearch.core.Nullable;
1922
import org.elasticsearch.index.Index;
2023
import org.elasticsearch.index.shard.ShardId;
2124
import org.elasticsearch.search.internal.AliasFilter;
@@ -35,28 +38,50 @@ public final class SearchShardsResponse extends ActionResponse {
3538
private final Collection<SearchShardsGroup> groups;
3639
private final Collection<DiscoveryNode> nodes;
3740
private final Map<String, AliasFilter> aliasFilters;
41+
private final ResolvedIndexExpressions resolvedIndexExpressions;
42+
public static final TransportVersion SEARCH_SHARDS_RESOLVED_INDEX_EXPRESSIONS = TransportVersion.fromName(
43+
"search_shards_resolved_index_expressions"
44+
);
3845

3946
public SearchShardsResponse(
4047
Collection<SearchShardsGroup> groups,
4148
Collection<DiscoveryNode> nodes,
42-
Map<String, AliasFilter> aliasFilters
49+
Map<String, AliasFilter> aliasFilters,
50+
@Nullable ResolvedIndexExpressions resolvedIndexExpressions
4351
) {
4452
this.groups = groups;
4553
this.nodes = nodes;
4654
this.aliasFilters = aliasFilters;
55+
this.resolvedIndexExpressions = resolvedIndexExpressions;
56+
}
57+
58+
public SearchShardsResponse(
59+
Collection<SearchShardsGroup> groups,
60+
Collection<DiscoveryNode> nodes,
61+
Map<String, AliasFilter> aliasFilters
62+
) {
63+
this(groups, nodes, aliasFilters, null);
4764
}
4865

4966
public SearchShardsResponse(StreamInput in) throws IOException {
5067
this.groups = in.readCollectionAsList(SearchShardsGroup::new);
5168
this.nodes = in.readCollectionAsList(DiscoveryNode::new);
5269
this.aliasFilters = in.readMap(AliasFilter::readFrom);
70+
if (in.getTransportVersion().supports(SEARCH_SHARDS_RESOLVED_INDEX_EXPRESSIONS)) {
71+
this.resolvedIndexExpressions = in.readOptionalWriteable(ResolvedIndexExpressions::new);
72+
} else {
73+
this.resolvedIndexExpressions = null;
74+
}
5375
}
5476

5577
@Override
5678
public void writeTo(StreamOutput out) throws IOException {
5779
out.writeCollection(groups);
5880
out.writeCollection(nodes);
5981
out.writeMap(aliasFilters, StreamOutput::writeWriteable);
82+
if (out.getTransportVersion().supports(SEARCH_SHARDS_RESOLVED_INDEX_EXPRESSIONS)) {
83+
out.writeOptionalWriteable(resolvedIndexExpressions);
84+
}
6085
}
6186

6287
/**
@@ -114,4 +139,9 @@ static SearchShardsResponse fromLegacyResponse(ClusterSearchShardsResponse oldRe
114139
public String toString() {
115140
return "SearchShardsResponse{" + "groups=" + groups + ", nodes=" + nodes + ", aliasFilters=" + aliasFilters + '}';
116141
}
142+
143+
@Nullable
144+
public ResolvedIndexExpressions getResolvedIndexExpressions() {
145+
return resolvedIndexExpressions;
146+
}
117147
}

0 commit comments

Comments
 (0)