From 8cedce8c672f0cd286ce5de9e75dae06a417c80b Mon Sep 17 00:00:00 2001 From: Craig Perkins Date: Fri, 4 Aug 2023 12:47:08 -0400 Subject: [PATCH 1/2] Make SearchTemplateRequest implement IndicesRequest.Replaceable Signed-off-by: Craig Perkins --- .../mustache/SearchTemplateRequest.java | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/modules/lang-mustache/src/main/java/org/opensearch/script/mustache/SearchTemplateRequest.java b/modules/lang-mustache/src/main/java/org/opensearch/script/mustache/SearchTemplateRequest.java index c963ea7ba7da9..8a8a3a42f06fb 100644 --- a/modules/lang-mustache/src/main/java/org/opensearch/script/mustache/SearchTemplateRequest.java +++ b/modules/lang-mustache/src/main/java/org/opensearch/script/mustache/SearchTemplateRequest.java @@ -35,7 +35,9 @@ import org.opensearch.action.ActionRequest; import org.opensearch.action.ActionRequestValidationException; import org.opensearch.action.CompositeIndicesRequest; +import org.opensearch.action.IndicesRequest; import org.opensearch.action.search.SearchRequest; +import org.opensearch.action.support.IndicesOptions; import org.opensearch.core.ParseField; import org.opensearch.core.common.ParsingException; import org.opensearch.common.Strings; @@ -57,7 +59,7 @@ /** * A request to execute a search based on a search template. */ -public class SearchTemplateRequest extends ActionRequest implements CompositeIndicesRequest, ToXContentObject { +public class SearchTemplateRequest extends ActionRequest implements IndicesRequest.Replaceable, CompositeIndicesRequest, ToXContentObject { private SearchRequest request; private boolean simulate = false; @@ -255,4 +257,19 @@ public void writeTo(StreamOutput out) throws IOException { out.writeMap(scriptParams); } } + + @Override + public String[] indices() { + return request.indices(); + } + + @Override + public IndicesOptions indicesOptions() { + return request.indicesOptions(); + } + + @Override + public IndicesRequest indices(String... indices) { + return request.indices(indices); + } } From 0110aaaac038ddeaa13ea0207324782e91b318a4 Mon Sep 17 00:00:00 2001 From: Craig Perkins Date: Fri, 4 Aug 2023 13:39:20 -0400 Subject: [PATCH 2/2] Add to CHANGELOG Signed-off-by: Craig Perkins --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3b81cd3a60deb..0d3f83aac49f1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -82,6 +82,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), - [distribution/archives] [Linux] [x64] Provide the variant of the distributions bundled with JRE ([#8195]()https://github.com/opensearch-project/OpenSearch/pull/8195) - Add configuration for file cache size to max remote data ratio to prevent oversubscription of file cache ([#8606](https://github.com/opensearch-project/OpenSearch/pull/8606)) - Disallow compression level to be set for default and best_compression index codecs ([#8737]()https://github.com/opensearch-project/OpenSearch/pull/8737) +- Make SearchTemplateRequest implement IndicesRequest.Replaceable ([#9122]()https://github.com/opensearch-project/OpenSearch/pull/9122) ### Dependencies - Bump `org.apache.logging.log4j:log4j-core` from 2.17.1 to 2.20.0 ([#8307](https://github.com/opensearch-project/OpenSearch/pull/8307))