[Rename] modules/lang-mustache (#208)
Refactor lang-mustache module as part of the Elasticsearch to OpenSearch renaming. Signed-off-by: Rabi Panda <adnapibar@gmail.com>
This commit is contained in:
parent
aa82008ae7
commit
03bd0b36fd
|
@ -80,8 +80,8 @@ import org.elasticsearch.index.reindex.ReindexRequest;
|
|||
import org.elasticsearch.index.reindex.UpdateByQueryRequest;
|
||||
import org.elasticsearch.index.seqno.SequenceNumbers;
|
||||
import org.elasticsearch.rest.action.search.RestSearchAction;
|
||||
import org.elasticsearch.script.mustache.MultiSearchTemplateRequest;
|
||||
import org.elasticsearch.script.mustache.SearchTemplateRequest;
|
||||
import org.opensearch.script.mustache.MultiSearchTemplateRequest;
|
||||
import org.opensearch.script.mustache.SearchTemplateRequest;
|
||||
import org.elasticsearch.search.fetch.subphase.FetchSourceContext;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
|
|
|
@ -82,10 +82,10 @@ import org.elasticsearch.index.reindex.UpdateByQueryRequest;
|
|||
import org.elasticsearch.plugins.spi.NamedXContentProvider;
|
||||
import org.elasticsearch.rest.BytesRestResponse;
|
||||
import org.elasticsearch.rest.RestStatus;
|
||||
import org.elasticsearch.script.mustache.MultiSearchTemplateRequest;
|
||||
import org.elasticsearch.script.mustache.MultiSearchTemplateResponse;
|
||||
import org.elasticsearch.script.mustache.SearchTemplateRequest;
|
||||
import org.elasticsearch.script.mustache.SearchTemplateResponse;
|
||||
import org.opensearch.script.mustache.MultiSearchTemplateRequest;
|
||||
import org.opensearch.script.mustache.MultiSearchTemplateResponse;
|
||||
import org.opensearch.script.mustache.SearchTemplateRequest;
|
||||
import org.opensearch.script.mustache.SearchTemplateResponse;
|
||||
import org.elasticsearch.search.aggregations.Aggregation;
|
||||
import org.elasticsearch.search.aggregations.bucket.adjacency.AdjacencyMatrixAggregationBuilder;
|
||||
import org.elasticsearch.search.aggregations.bucket.adjacency.ParsedAdjacencyMatrix;
|
||||
|
@ -224,8 +224,8 @@ import static java.util.stream.Collectors.toList;
|
|||
* {@link #RestHighLevelClient(RestClient, CheckedConsumer, List)} constructor can be used.
|
||||
* <p>
|
||||
*
|
||||
* This class can also be sub-classed to expose additional client methods that make use of endpoints added to Elasticsearch through plugins,
|
||||
* or to add support for custom response sections, again added to Elasticsearch through plugins.
|
||||
* This class can also be sub-classed to expose additional client methods that make use of endpoints added to OpenSearch through plugins,
|
||||
* or to add support for custom response sections, again added to OpenSearch through plugins.
|
||||
* <p>
|
||||
*
|
||||
* The majority of the methods in this class come in two flavors, a blocking and an asynchronous version (e.g.
|
||||
|
@ -236,7 +236,7 @@ import static java.util.stream.Collectors.toList;
|
|||
*
|
||||
* <ul>
|
||||
* <li>an {@link IOException} is usually thrown in case of failing to parse the REST response in the high-level REST client, the request
|
||||
* times out or similar cases where there is no response coming back from the Elasticsearch server</li>
|
||||
* times out or similar cases where there is no response coming back from the OpenSearch server</li>
|
||||
* <li>an {@link OpenSearchException} is usually thrown in case where the server returns a 4xx or 5xx error code. The high-level client
|
||||
* then tries to parse the response body error details into a generic OpenSearchException and suppresses the original
|
||||
* {@link ResponseException}</li>
|
||||
|
@ -265,7 +265,7 @@ public class RestHighLevelClient implements Closeable {
|
|||
|
||||
/**
|
||||
* Creates a {@link RestHighLevelClient} given the low level {@link RestClientBuilder} that allows to build the
|
||||
* {@link RestClient} to be used to perform requests and parsers for custom response sections added to Elasticsearch through plugins.
|
||||
* {@link RestClient} to be used to perform requests and parsers for custom response sections added to OpenSearch through plugins.
|
||||
*/
|
||||
protected RestHighLevelClient(RestClientBuilder restClientBuilder, List<NamedXContentRegistry.Entry> namedXContentEntries) {
|
||||
this(restClientBuilder.build(), RestClient::close, namedXContentEntries);
|
||||
|
@ -273,10 +273,10 @@ public class RestHighLevelClient implements Closeable {
|
|||
|
||||
/**
|
||||
* Creates a {@link RestHighLevelClient} given the low level {@link RestClient} that it should use to perform requests and
|
||||
* a list of entries that allow to parse custom response sections added to Elasticsearch through plugins.
|
||||
* a list of entries that allow to parse custom response sections added to OpenSearch through plugins.
|
||||
* This constructor can be called by subclasses in case an externally created low-level REST client needs to be provided.
|
||||
* The consumer argument allows to control what needs to be done when the {@link #close()} method is called.
|
||||
* Also subclasses can provide parsers for custom response sections added to Elasticsearch through plugins.
|
||||
* Also subclasses can provide parsers for custom response sections added to OpenSearch through plugins.
|
||||
*/
|
||||
protected RestHighLevelClient(RestClient restClient, CheckedConsumer<RestClient, IOException> doClose,
|
||||
List<NamedXContentRegistry.Entry> namedXContentEntries) {
|
||||
|
@ -585,7 +585,7 @@ public class RestHighLevelClient implements Closeable {
|
|||
}
|
||||
|
||||
/**
|
||||
* Pings the remote Elasticsearch cluster and returns true if the ping succeeded, false otherwise
|
||||
* Pings the remote OpenSearch cluster and returns true if the ping succeeded, false otherwise
|
||||
* @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized
|
||||
* @return <code>true</code> if the ping succeeded, false otherwise
|
||||
*/
|
||||
|
@ -1719,7 +1719,7 @@ public class RestHighLevelClient implements Closeable {
|
|||
throw new IllegalStateException("Response body expected but not returned");
|
||||
}
|
||||
if (entity.getContentType() == null) {
|
||||
throw new IllegalStateException("Elasticsearch didn't return the [Content-Type] header, unable to parse response body");
|
||||
throw new IllegalStateException("OpenSearch didn't return the [Content-Type] header, unable to parse response body");
|
||||
}
|
||||
XContentType xContentType = XContentType.fromMediaTypeOrFormat(entity.getContentType().getValue());
|
||||
if (xContentType == null) {
|
||||
|
@ -1736,9 +1736,9 @@ public class RestHighLevelClient implements Closeable {
|
|||
|
||||
/**
|
||||
* Ignores deprecation warnings. This is appropriate because it is only
|
||||
* used to parse responses from Elasticsearch. Any deprecation warnings
|
||||
* used to parse responses from OpenSearch. Any deprecation warnings
|
||||
* emitted there just mean that you are talking to an old version of
|
||||
* Elasticsearch. There isn't anything you can do about the deprecation.
|
||||
* OpenSearch. There isn't anything you can do about the deprecation.
|
||||
*/
|
||||
private static final DeprecationHandler DEPRECATION_HANDLER = DeprecationHandler.IGNORE_DEPRECATIONS;
|
||||
|
||||
|
|
|
@ -90,8 +90,8 @@ import org.elasticsearch.index.reindex.UpdateByQueryRequest;
|
|||
import org.elasticsearch.rest.action.search.RestSearchAction;
|
||||
import org.elasticsearch.script.Script;
|
||||
import org.elasticsearch.script.ScriptType;
|
||||
import org.elasticsearch.script.mustache.MultiSearchTemplateRequest;
|
||||
import org.elasticsearch.script.mustache.SearchTemplateRequest;
|
||||
import org.opensearch.script.mustache.MultiSearchTemplateRequest;
|
||||
import org.opensearch.script.mustache.SearchTemplateRequest;
|
||||
import org.elasticsearch.search.Scroll;
|
||||
import org.elasticsearch.search.aggregations.bucket.terms.TermsAggregationBuilder;
|
||||
import org.elasticsearch.search.aggregations.support.ValueType;
|
||||
|
|
|
@ -54,11 +54,11 @@ import org.elasticsearch.rest.RestStatus;
|
|||
import org.elasticsearch.rest.action.document.RestIndexAction;
|
||||
import org.elasticsearch.script.Script;
|
||||
import org.elasticsearch.script.ScriptType;
|
||||
import org.elasticsearch.script.mustache.MultiSearchTemplateRequest;
|
||||
import org.elasticsearch.script.mustache.MultiSearchTemplateResponse;
|
||||
import org.elasticsearch.script.mustache.MultiSearchTemplateResponse.Item;
|
||||
import org.elasticsearch.script.mustache.SearchTemplateRequest;
|
||||
import org.elasticsearch.script.mustache.SearchTemplateResponse;
|
||||
import org.opensearch.script.mustache.MultiSearchTemplateRequest;
|
||||
import org.opensearch.script.mustache.MultiSearchTemplateResponse;
|
||||
import org.opensearch.script.mustache.MultiSearchTemplateResponse.Item;
|
||||
import org.opensearch.script.mustache.SearchTemplateRequest;
|
||||
import org.opensearch.script.mustache.SearchTemplateResponse;
|
||||
import org.elasticsearch.search.SearchHit;
|
||||
import org.elasticsearch.search.aggregations.AggregationBuilders;
|
||||
import org.elasticsearch.search.aggregations.BucketOrder;
|
||||
|
@ -1154,7 +1154,7 @@ public class SearchIT extends ESRestHighLevelClientTestCase {
|
|||
assertThat(exception.status(), equalTo(RestStatus.NOT_FOUND));
|
||||
assertThat(exception.getIndex().getName(), equalTo("non_existent_index"));
|
||||
assertThat(exception.getDetailedMessage(),
|
||||
containsString("Elasticsearch exception [type=index_not_found_exception, reason=no such index [non_existent_index]]"));
|
||||
containsString("OpenSearch exception [type=index_not_found_exception, reason=no such index [non_existent_index]]"));
|
||||
}
|
||||
{
|
||||
ExplainRequest explainRequest = new ExplainRequest("index1", "999");
|
||||
|
|
|
@ -75,11 +75,11 @@ import org.elasticsearch.index.rankeval.RatedRequest;
|
|||
import org.elasticsearch.index.rankeval.RatedSearchHit;
|
||||
import org.elasticsearch.rest.RestStatus;
|
||||
import org.elasticsearch.script.ScriptType;
|
||||
import org.elasticsearch.script.mustache.MultiSearchTemplateRequest;
|
||||
import org.elasticsearch.script.mustache.MultiSearchTemplateResponse;
|
||||
import org.elasticsearch.script.mustache.MultiSearchTemplateResponse.Item;
|
||||
import org.elasticsearch.script.mustache.SearchTemplateRequest;
|
||||
import org.elasticsearch.script.mustache.SearchTemplateResponse;
|
||||
import org.opensearch.script.mustache.MultiSearchTemplateRequest;
|
||||
import org.opensearch.script.mustache.MultiSearchTemplateResponse;
|
||||
import org.opensearch.script.mustache.MultiSearchTemplateResponse.Item;
|
||||
import org.opensearch.script.mustache.SearchTemplateRequest;
|
||||
import org.opensearch.script.mustache.SearchTemplateResponse;
|
||||
import org.elasticsearch.search.Scroll;
|
||||
import org.elasticsearch.search.SearchHit;
|
||||
import org.elasticsearch.search.SearchHits;
|
||||
|
@ -345,8 +345,8 @@ public class SearchDocumentationIT extends ESRestHighLevelClientTestCase {
|
|||
// end::search-request-aggregations-get-wrongCast
|
||||
} catch (ClassCastException ex) {
|
||||
String message = ex.getMessage();
|
||||
assertThat(message, containsString("org.elasticsearch.search.aggregations.bucket.terms.ParsedStringTerms"));
|
||||
assertThat(message, containsString("org.elasticsearch.search.aggregations.bucket.range.Range"));
|
||||
assertThat(message, containsString("org.opensearch.search.aggregations.bucket.terms.ParsedStringTerms"));
|
||||
assertThat(message, containsString("org.opensearch.search.aggregations.bucket.range.Range"));
|
||||
}
|
||||
assertEquals(3, elasticBucket.getDocCount());
|
||||
assertEquals(30, avg, 0.0);
|
||||
|
@ -426,13 +426,13 @@ public class SearchDocumentationIT extends ESRestHighLevelClientTestCase {
|
|||
{
|
||||
BulkRequest request = new BulkRequest();
|
||||
request.add(new IndexRequest("posts").id("1")
|
||||
.source(XContentType.JSON, "title", "In which order are my Elasticsearch queries executed?", "user",
|
||||
.source(XContentType.JSON, "title", "In which order are my OpenSearch queries executed?", "user",
|
||||
Arrays.asList("kimchy", "luca"), "innerObject", Collections.singletonMap("key", "value")));
|
||||
request.add(new IndexRequest("posts").id("2")
|
||||
.source(XContentType.JSON, "title", "Current status and upcoming changes in Elasticsearch", "user",
|
||||
.source(XContentType.JSON, "title", "Current status and upcoming changes in OpenSearch", "user",
|
||||
Arrays.asList("kimchy", "christoph"), "innerObject", Collections.singletonMap("key", "value")));
|
||||
request.add(new IndexRequest("posts").id("3")
|
||||
.source(XContentType.JSON, "title", "The Future of Federated Search in Elasticsearch", "user",
|
||||
.source(XContentType.JSON, "title", "The Future of Federated Search in OpenSearch", "user",
|
||||
Arrays.asList("kimchy", "tanguy"), "innerObject", Collections.singletonMap("key", "value")));
|
||||
request.setRefreshPolicy(WriteRequest.RefreshPolicy.IMMEDIATE);
|
||||
BulkResponse bulkResponse = client.bulk(request, RequestOptions.DEFAULT);
|
||||
|
@ -489,7 +489,7 @@ public class SearchDocumentationIT extends ESRestHighLevelClientTestCase {
|
|||
RestHighLevelClient client = highLevelClient();
|
||||
{
|
||||
IndexRequest request = new IndexRequest("posts").id("1")
|
||||
.source(XContentType.JSON, "tags", "elasticsearch", "comments", 123);
|
||||
.source(XContentType.JSON, "tags", "opensearch", "comments", 123);
|
||||
request.setRefreshPolicy(WriteRequest.RefreshPolicy.WAIT_UNTIL);
|
||||
IndexResponse indexResponse = client.index(request, RequestOptions.DEFAULT);
|
||||
assertSame(RestStatus.CREATED, indexResponse.status());
|
||||
|
@ -500,7 +500,7 @@ public class SearchDocumentationIT extends ESRestHighLevelClientTestCase {
|
|||
SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder();
|
||||
searchSourceBuilder.profile(true);
|
||||
// end::search-request-profiling
|
||||
searchSourceBuilder.query(QueryBuilders.termQuery("tags", "elasticsearch"));
|
||||
searchSourceBuilder.query(QueryBuilders.termQuery("tags", "opensearch"));
|
||||
searchSourceBuilder.aggregation(AggregationBuilders.histogram("by_comments").field("comments").interval(100));
|
||||
searchRequest.source(searchSourceBuilder);
|
||||
|
||||
|
@ -561,11 +561,11 @@ public class SearchDocumentationIT extends ESRestHighLevelClientTestCase {
|
|||
{
|
||||
BulkRequest request = new BulkRequest();
|
||||
request.add(new IndexRequest("posts").id("1")
|
||||
.source(XContentType.JSON, "title", "In which order are my Elasticsearch queries executed?"));
|
||||
.source(XContentType.JSON, "title", "In which order are my OpenSearch queries executed?"));
|
||||
request.add(new IndexRequest("posts").id("2")
|
||||
.source(XContentType.JSON, "title", "Current status and upcoming changes in Elasticsearch"));
|
||||
.source(XContentType.JSON, "title", "Current status and upcoming changes in OpenSearch"));
|
||||
request.add(new IndexRequest("posts").id("3")
|
||||
.source(XContentType.JSON, "title", "The Future of Federated Search in Elasticsearch"));
|
||||
.source(XContentType.JSON, "title", "The Future of Federated Search in OpenSearch"));
|
||||
request.setRefreshPolicy(WriteRequest.RefreshPolicy.IMMEDIATE);
|
||||
BulkResponse bulkResponse = client.bulk(request, RequestOptions.DEFAULT);
|
||||
assertSame(RestStatus.OK, bulkResponse.status());
|
||||
|
@ -576,7 +576,7 @@ public class SearchDocumentationIT extends ESRestHighLevelClientTestCase {
|
|||
// tag::search-scroll-init
|
||||
SearchRequest searchRequest = new SearchRequest("posts");
|
||||
SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder();
|
||||
searchSourceBuilder.query(matchQuery("title", "Elasticsearch"));
|
||||
searchSourceBuilder.query(matchQuery("title", "OpenSearch"));
|
||||
searchSourceBuilder.size(size); // <1>
|
||||
searchRequest.source(searchSourceBuilder);
|
||||
searchRequest.scroll(TimeValue.timeValueMinutes(1L)); // <2>
|
||||
|
@ -708,7 +708,7 @@ public class SearchDocumentationIT extends ESRestHighLevelClientTestCase {
|
|||
SearchRequest searchRequest = new SearchRequest("posts");
|
||||
searchRequest.scroll(scroll);
|
||||
SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder();
|
||||
searchSourceBuilder.query(matchQuery("title", "Elasticsearch"));
|
||||
searchSourceBuilder.query(matchQuery("title", "OpenSearch"));
|
||||
searchRequest.source(searchSourceBuilder);
|
||||
|
||||
SearchResponse searchResponse = client.search(searchRequest, RequestOptions.DEFAULT); // <1>
|
||||
|
@ -750,7 +750,7 @@ public class SearchDocumentationIT extends ESRestHighLevelClientTestCase {
|
|||
|
||||
Map<String, Object> scriptParams = new HashMap<>();
|
||||
scriptParams.put("field", "title");
|
||||
scriptParams.put("value", "elasticsearch");
|
||||
scriptParams.put("value", "opensearch");
|
||||
scriptParams.put("size", 5);
|
||||
request.setScriptParams(scriptParams); // <3>
|
||||
// end::search-template-request-inline
|
||||
|
@ -774,7 +774,7 @@ public class SearchDocumentationIT extends ESRestHighLevelClientTestCase {
|
|||
|
||||
assertNotNull(source);
|
||||
assertEquals(
|
||||
("{ \"size\" : \"5\", \"query\": { \"match\" : { \"title\" : \"elasticsearch\" } }}").replaceAll("\\s+", ""),
|
||||
("{ \"size\" : \"5\", \"query\": { \"match\" : { \"title\" : \"opensearch\" } }}").replaceAll("\\s+", ""),
|
||||
source.utf8ToString()
|
||||
);
|
||||
}
|
||||
|
@ -795,7 +795,7 @@ public class SearchDocumentationIT extends ESRestHighLevelClientTestCase {
|
|||
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("field", "title");
|
||||
params.put("value", "elasticsearch");
|
||||
params.put("value", "opensearch");
|
||||
params.put("size", 5);
|
||||
request.setScriptParams(params);
|
||||
// end::search-template-request-stored
|
||||
|
@ -1280,13 +1280,13 @@ public class SearchDocumentationIT extends ESRestHighLevelClientTestCase {
|
|||
|
||||
BulkRequest bulkRequest = new BulkRequest();
|
||||
bulkRequest.add(new IndexRequest("posts").id("1")
|
||||
.source(XContentType.JSON, "id", 1, "title", "In which order are my Elasticsearch queries executed?", "user",
|
||||
.source(XContentType.JSON, "id", 1, "title", "In which order are my OpenSearch queries executed?", "user",
|
||||
Arrays.asList("kimchy", "luca"), "innerObject", Collections.singletonMap("key", "value")));
|
||||
bulkRequest.add(new IndexRequest("posts").id("2")
|
||||
.source(XContentType.JSON, "id", 2, "title", "Current status and upcoming changes in Elasticsearch", "user",
|
||||
.source(XContentType.JSON, "id", 2, "title", "Current status and upcoming changes in OpenSearch", "user",
|
||||
Arrays.asList("kimchy", "christoph"), "innerObject", Collections.singletonMap("key", "value")));
|
||||
bulkRequest.add(new IndexRequest("posts").id("3")
|
||||
.source(XContentType.JSON, "id", 3, "title", "The Future of Federated Search in Elasticsearch", "user",
|
||||
.source(XContentType.JSON, "id", 3, "title", "The Future of Federated Search in OpenSearch", "user",
|
||||
Arrays.asList("kimchy", "tanguy"), "innerObject", Collections.singletonMap("key", "value")));
|
||||
|
||||
bulkRequest.add(new IndexRequest("authors").id("1")
|
||||
|
|
|
@ -30,7 +30,7 @@ import org.elasticsearch.index.reindex.ReindexPlugin;
|
|||
import org.elasticsearch.join.ParentJoinPlugin;
|
||||
import org.elasticsearch.percolator.PercolatorPlugin;
|
||||
import org.elasticsearch.plugins.Plugin;
|
||||
import org.elasticsearch.script.mustache.MustachePlugin;
|
||||
import org.opensearch.script.mustache.MustachePlugin;
|
||||
import org.elasticsearch.transport.Netty4Plugin;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
@ -45,10 +45,9 @@ import java.util.concurrent.TimeUnit;
|
|||
* {@link PercolatorPlugin},
|
||||
* {@link MustachePlugin},
|
||||
* {@link ParentJoinPlugin}
|
||||
* plugins for the client. These plugins are all the required modules for Elasticsearch.
|
||||
* plugins for the client. These plugins are all the required modules for OpenSearch.
|
||||
*
|
||||
* @deprecated {@link TransportClient} is deprecated in favour of the High Level REST client and will
|
||||
* be removed in Elasticsearch 8.0.
|
||||
* @deprecated {@link TransportClient} is deprecated in favour of the High Level REST client.
|
||||
*/
|
||||
@SuppressWarnings({"unchecked","varargs"})
|
||||
@Deprecated
|
||||
|
|
|
@ -27,7 +27,7 @@ import org.elasticsearch.index.reindex.ReindexPlugin;
|
|||
import org.elasticsearch.join.ParentJoinPlugin;
|
||||
import org.elasticsearch.percolator.PercolatorPlugin;
|
||||
import org.elasticsearch.plugins.Plugin;
|
||||
import org.elasticsearch.script.mustache.MustachePlugin;
|
||||
import org.opensearch.script.mustache.MustachePlugin;
|
||||
import org.elasticsearch.transport.Netty4Plugin;
|
||||
import org.junit.Test;
|
||||
|
||||
|
|
|
@ -16,13 +16,13 @@
|
|||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
apply plugin: 'elasticsearch.yaml-rest-test'
|
||||
apply plugin: 'elasticsearch.java-rest-test'
|
||||
apply plugin: 'elasticsearch.internal-cluster-test'
|
||||
apply plugin: 'opensearch.yaml-rest-test'
|
||||
apply plugin: 'opensearch.java-rest-test'
|
||||
apply plugin: 'opensearch.internal-cluster-test'
|
||||
|
||||
esplugin {
|
||||
description 'Mustache scripting integration for Elasticsearch'
|
||||
classname 'org.elasticsearch.script.mustache.MustachePlugin'
|
||||
description 'Mustache scripting integration for OpenSearch'
|
||||
classname 'org.opensearch.script.mustache.MustachePlugin'
|
||||
hasClientJar = true // For the template apis and query
|
||||
}
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
package org.elasticsearch.script.mustache;
|
||||
package org.opensearch.script.mustache;
|
||||
|
||||
import org.elasticsearch.action.index.IndexRequestBuilder;
|
||||
import org.elasticsearch.action.search.SearchRequest;
|
|
@ -16,7 +16,7 @@
|
|||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.elasticsearch.script.mustache;
|
||||
package org.opensearch.script.mustache;
|
||||
|
||||
import org.elasticsearch.ResourceNotFoundException;
|
||||
import org.elasticsearch.action.admin.cluster.storedscripts.GetStoredScriptResponse;
|
|
@ -17,7 +17,7 @@
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
package org.elasticsearch.script.mustache;
|
||||
package org.opensearch.script.mustache;
|
||||
|
||||
import org.elasticsearch.client.Request;
|
||||
import org.elasticsearch.client.ResponseException;
|
|
@ -17,7 +17,7 @@
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
package org.elasticsearch.script.mustache;
|
||||
package org.opensearch.script.mustache;
|
||||
|
||||
import com.fasterxml.jackson.core.io.JsonStringEncoder;
|
||||
import com.github.mustachejava.Code;
|
|
@ -17,7 +17,7 @@
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
package org.elasticsearch.script.mustache;
|
||||
package org.opensearch.script.mustache;
|
||||
|
||||
import com.github.mustachejava.reflect.ReflectionObjectHandler;
|
||||
import org.elasticsearch.common.util.CollectionUtils;
|
|
@ -17,7 +17,7 @@
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
package org.elasticsearch.script.mustache;
|
||||
package org.opensearch.script.mustache;
|
||||
|
||||
import org.elasticsearch.action.ActionType;
|
||||
|
|
@ -17,7 +17,7 @@
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
package org.elasticsearch.script.mustache;
|
||||
package org.opensearch.script.mustache;
|
||||
|
||||
import org.elasticsearch.action.ActionRequest;
|
||||
import org.elasticsearch.action.ActionRequestValidationException;
|
|
@ -17,7 +17,7 @@
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
package org.elasticsearch.script.mustache;
|
||||
package org.opensearch.script.mustache;
|
||||
|
||||
import org.elasticsearch.OpenSearchException;
|
||||
import org.elasticsearch.Version;
|
|
@ -17,7 +17,7 @@
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
package org.elasticsearch.script.mustache;
|
||||
package org.opensearch.script.mustache;
|
||||
|
||||
import org.elasticsearch.action.ActionRequest;
|
||||
import org.elasticsearch.action.ActionResponse;
|
|
@ -16,7 +16,7 @@
|
|||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.elasticsearch.script.mustache;
|
||||
package org.opensearch.script.mustache;
|
||||
|
||||
import com.github.mustachejava.Mustache;
|
||||
import com.github.mustachejava.MustacheException;
|
|
@ -17,7 +17,7 @@
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
package org.elasticsearch.script.mustache;
|
||||
package org.opensearch.script.mustache;
|
||||
|
||||
import org.elasticsearch.client.node.NodeClient;
|
||||
import org.elasticsearch.common.logging.DeprecationLogger;
|
|
@ -17,7 +17,7 @@
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
package org.elasticsearch.script.mustache;
|
||||
package org.opensearch.script.mustache;
|
||||
|
||||
import org.elasticsearch.client.node.NodeClient;
|
||||
import org.elasticsearch.common.xcontent.XContentParser;
|
|
@ -17,7 +17,7 @@
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
package org.elasticsearch.script.mustache;
|
||||
package org.opensearch.script.mustache;
|
||||
|
||||
import org.elasticsearch.action.search.SearchRequest;
|
||||
import org.elasticsearch.client.node.NodeClient;
|
|
@ -17,7 +17,7 @@
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
package org.elasticsearch.script.mustache;
|
||||
package org.opensearch.script.mustache;
|
||||
|
||||
import org.elasticsearch.action.ActionType;
|
||||
|
|
@ -17,7 +17,7 @@
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
package org.elasticsearch.script.mustache;
|
||||
package org.opensearch.script.mustache;
|
||||
|
||||
import org.elasticsearch.action.ActionRequest;
|
||||
import org.elasticsearch.action.ActionRequestValidationException;
|
|
@ -17,7 +17,7 @@
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
package org.elasticsearch.script.mustache;
|
||||
package org.opensearch.script.mustache;
|
||||
|
||||
import org.elasticsearch.action.ActionRequestBuilder;
|
||||
import org.elasticsearch.action.search.SearchRequest;
|
|
@ -17,7 +17,7 @@
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
package org.elasticsearch.script.mustache;
|
||||
package org.opensearch.script.mustache;
|
||||
|
||||
import org.elasticsearch.action.ActionResponse;
|
||||
import org.elasticsearch.action.search.SearchResponse;
|
||||
|
@ -72,7 +72,7 @@ public class SearchTemplateResponse extends ActionResponse implements StatusToXC
|
|||
|
||||
public boolean hasResponse() {
|
||||
return response != null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
|
@ -17,7 +17,7 @@
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
package org.elasticsearch.script.mustache;
|
||||
package org.opensearch.script.mustache;
|
||||
|
||||
import org.elasticsearch.action.ActionListener;
|
||||
import org.elasticsearch.action.search.MultiSearchRequest;
|
||||
|
@ -35,7 +35,7 @@ import org.elasticsearch.transport.TransportService;
|
|||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import static org.elasticsearch.script.mustache.TransportSearchTemplateAction.convert;
|
||||
import static org.opensearch.script.mustache.TransportSearchTemplateAction.convert;
|
||||
|
||||
public class TransportMultiSearchTemplateAction extends HandledTransportAction<MultiSearchTemplateRequest, MultiSearchTemplateResponse> {
|
||||
|
|
@ -17,7 +17,7 @@
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
package org.elasticsearch.script.mustache;
|
||||
package org.opensearch.script.mustache;
|
||||
|
||||
import org.elasticsearch.action.ActionListener;
|
||||
import org.elasticsearch.action.search.SearchRequest;
|
|
@ -17,7 +17,7 @@
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
package org.elasticsearch.script.mustache;
|
||||
package org.opensearch.script.mustache;
|
||||
|
||||
import org.elasticsearch.script.Script;
|
||||
import org.elasticsearch.script.ScriptEngine;
|
||||
|
@ -28,9 +28,9 @@ import java.util.Map;
|
|||
|
||||
import static java.util.Collections.emptyMap;
|
||||
import static java.util.Collections.singletonMap;
|
||||
import static org.elasticsearch.script.mustache.CustomMustacheFactory.JSON_MIME_TYPE;
|
||||
import static org.elasticsearch.script.mustache.CustomMustacheFactory.PLAIN_TEXT_MIME_TYPE;
|
||||
import static org.elasticsearch.script.mustache.CustomMustacheFactory.X_WWW_FORM_URLENCODED_MIME_TYPE;
|
||||
import static org.opensearch.script.mustache.CustomMustacheFactory.JSON_MIME_TYPE;
|
||||
import static org.opensearch.script.mustache.CustomMustacheFactory.PLAIN_TEXT_MIME_TYPE;
|
||||
import static org.opensearch.script.mustache.CustomMustacheFactory.X_WWW_FORM_URLENCODED_MIME_TYPE;
|
||||
import static org.hamcrest.Matchers.equalTo;
|
||||
import static org.hamcrest.Matchers.instanceOf;
|
||||
|
|
@ -17,7 +17,7 @@
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
package org.elasticsearch.script.mustache;
|
||||
package org.opensearch.script.mustache;
|
||||
|
||||
import org.elasticsearch.action.search.SearchRequest;
|
||||
import org.elasticsearch.common.bytes.BytesArray;
|
||||
|
@ -42,7 +42,7 @@ import static org.hamcrest.Matchers.nullValue;
|
|||
public class MultiSearchTemplateRequestTests extends ESTestCase {
|
||||
|
||||
public void testParseRequest() throws Exception {
|
||||
byte[] data = StreamsUtils.copyToBytesFromClasspath("/org/elasticsearch/script/mustache/simple-msearch-template.json");
|
||||
byte[] data = StreamsUtils.copyToBytesFromClasspath("/org/opensearch/script/mustache/simple-msearch-template.json");
|
||||
RestRequest restRequest = new FakeRestRequest.Builder(xContentRegistry())
|
||||
.withContent(new BytesArray(data), XContentType.JSON).build();
|
||||
|
|
@ -16,7 +16,7 @@
|
|||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.elasticsearch.script.mustache;
|
||||
package org.opensearch.script.mustache;
|
||||
|
||||
import org.elasticsearch.OpenSearchException;
|
||||
import org.elasticsearch.action.search.SearchResponse;
|
|
@ -16,7 +16,7 @@
|
|||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.elasticsearch.script.mustache;
|
||||
package org.opensearch.script.mustache;
|
||||
|
||||
import com.github.mustachejava.MustacheFactory;
|
||||
|
||||
|
@ -75,7 +75,7 @@ public class MustacheScriptEngineTests extends ESTestCase {
|
|||
|
||||
public void testSimple() throws IOException {
|
||||
String templateString =
|
||||
"{"
|
||||
"{"
|
||||
+ "\"source\":{\"match_{{template}}\": {}},"
|
||||
+ "\"params\":{\"template\":\"all\"}"
|
||||
+ "}";
|
|
@ -16,7 +16,7 @@
|
|||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.elasticsearch.script.mustache;
|
||||
package org.opensearch.script.mustache;
|
||||
|
||||
import org.elasticsearch.common.bytes.BytesReference;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
|
@ -16,7 +16,7 @@
|
|||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.elasticsearch.script.mustache;
|
||||
package org.opensearch.script.mustache;
|
||||
|
||||
import org.elasticsearch.common.bytes.BytesArray;
|
||||
import org.elasticsearch.common.settings.Settings;
|
|
@ -16,7 +16,7 @@
|
|||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.elasticsearch.script.mustache;
|
||||
package org.opensearch.script.mustache;
|
||||
|
||||
import org.elasticsearch.rest.RestRequest;
|
||||
import org.elasticsearch.rest.action.search.RestSearchAction;
|
|
@ -17,7 +17,7 @@
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
package org.elasticsearch.script.mustache;
|
||||
package org.opensearch.script.mustache;
|
||||
|
||||
import org.elasticsearch.common.io.stream.Writeable;
|
||||
import org.elasticsearch.script.ScriptType;
|
|
@ -17,7 +17,7 @@
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
package org.elasticsearch.script.mustache;
|
||||
package org.opensearch.script.mustache;
|
||||
|
||||
import org.elasticsearch.common.bytes.BytesReference;
|
||||
import org.elasticsearch.common.xcontent.ToXContent;
|
|
@ -17,7 +17,7 @@
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
package org.elasticsearch.script.mustache;
|
||||
package org.opensearch.script.mustache;
|
||||
|
||||
import org.apache.lucene.search.TotalHits;
|
||||
import org.elasticsearch.action.search.SearchResponse;
|
|
@ -17,7 +17,7 @@
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
package org.elasticsearch.script.mustache;
|
||||
package org.opensearch.script.mustache;
|
||||
|
||||
import com.carrotsearch.randomizedtesting.annotations.Name;
|
||||
import com.carrotsearch.randomizedtesting.annotations.ParametersFactory;
|
Loading…
Reference in New Issue