Skip to content

Commit

Permalink
Make SearchTemplateRequest implement IndicesRequest.Replaceable
Browse files Browse the repository at this point in the history
Signed-off-by: Craig Perkins <[email protected]>
  • Loading branch information
cwperks committed Aug 4, 2023
1 parent 24595c9 commit 8cedce8
Showing 1 changed file with 18 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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);
}
}

0 comments on commit 8cedce8

Please sign in to comment.