Skip to content

Commit 6ca7650

Browse files
cwperkslinuxpi
authored andcommitted
Make SearchTemplateRequest implement IndicesRequest.Replaceable (opensearch-project#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]>
1 parent 6bf742c commit 6ca7650

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
@@ -86,6 +86,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
8686
- Disallow compression level to be set for default and best_compression index codecs ([#8737]()https://github.com/opensearch-project/OpenSearch/pull/8737)
8787
- Prioritize replica shard movement during shard relocation ([#8875](https://github.com/opensearch-project/OpenSearch/pull/8875))
8888
- Introducing Default and Best Compression codecs as their algorithm name ([#9123]()https://github.com/opensearch-project/OpenSearch/pull/9123)
89+
- Make SearchTemplateRequest implement IndicesRequest.Replaceable ([#9122]()https://github.com/opensearch-project/OpenSearch/pull/9122)
8990

9091
### Dependencies
9192
- 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)