Skip to content

Commit b4e424c

Browse files
Make SearchTemplateRequest implement IndicesRequest.Replaceable (#9122)
* Make SearchTemplateRequest implement IndicesRequest.Replaceable Signed-off-by: Craig Perkins <[email protected]> * Add to CHANGELOG Signed-off-by: Craig Perkins <[email protected]> --------- Signed-off-by: Craig Perkins <[email protected]> (cherry picked from commit c73f727) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent bc69838 commit b4e424c

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
1313
- [distribution/archives] [Linux] [x64] Provide the variant of the distributions bundled with JRE ([#8195]()https://github.com/opensearch-project/OpenSearch/pull/8195)
1414
- Prioritize replica shard movement during shard relocation ([#8875](https://github.com/opensearch-project/OpenSearch/pull/8875))
1515
- Introducing Default and Best Compression codecs as their algorithm name ([#9123]()https://github.com/opensearch-project/OpenSearch/pull/9123)
16+
- Make SearchTemplateRequest implement IndicesRequest.Replaceable ([#9122]()https://github.com/opensearch-project/OpenSearch/pull/9122)
1617

1718
### Dependencies
1819
- Bump `org.apache.logging.log4j:log4j-core` from 2.17.1 to 2.20.0 ([#8307](https://github.com/opensearch-project/OpenSearch/pull/8307))

modules/lang-mustache/src/main/java/org/opensearch/script/mustache/SearchTemplateRequest.java

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,9 @@
3535
import org.opensearch.action.ActionRequest;
3636
import org.opensearch.action.ActionRequestValidationException;
3737
import org.opensearch.action.CompositeIndicesRequest;
38+
import org.opensearch.action.IndicesRequest;
3839
import org.opensearch.action.search.SearchRequest;
40+
import org.opensearch.action.support.IndicesOptions;
3941
import org.opensearch.core.ParseField;
4042
import org.opensearch.core.common.ParsingException;
4143
import org.opensearch.core.common.io.stream.StreamInput;
@@ -56,7 +58,7 @@
5658
/**
5759
* A request to execute a search based on a search template.
5860
*/
59-
public class SearchTemplateRequest extends ActionRequest implements CompositeIndicesRequest, ToXContentObject {
61+
public class SearchTemplateRequest extends ActionRequest implements IndicesRequest.Replaceable, CompositeIndicesRequest, ToXContentObject {
6062

6163
private SearchRequest request;
6264
private boolean simulate = false;
@@ -254,4 +256,19 @@ public void writeTo(StreamOutput out) throws IOException {
254256
out.writeMap(scriptParams);
255257
}
256258
}
259+
260+
@Override
261+
public String[] indices() {
262+
return request.indices();
263+
}
264+
265+
@Override
266+
public IndicesOptions indicesOptions() {
267+
return request.indicesOptions();
268+
}
269+
270+
@Override
271+
public IndicesRequest indices(String... indices) {
272+
return request.indices(indices);
273+
}
257274
}

0 commit comments

Comments
 (0)