本文整理了Java中org.elasticsearch.client.Client.execute()
方法的一些代码示例,展示了Client.execute()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Client.execute()
方法的具体详情如下:
包路径:org.elasticsearch.client.Client
类名称:Client
方法名:execute
暂无
代码示例来源:origin: floragunncom/search-guard
final WhoAmIResponse whoAmIRes = tc.execute(WhoAmIAction.INSTANCE, new WhoAmIRequest()).actionGet();
sb.append(Strings.toString(whoAmIRes,true, true));
} catch (Exception e1) {
LicenseInfoResponse res = tc.execute(LicenseInfoAction.INSTANCE, new LicenseInfoRequest()).actionGet();
sb.append(Strings.toString(res,true, true));
} catch (Exception e1) {
代码示例来源:origin: org.elasticsearch/elasticsearch
@Override
protected <Request extends ActionRequest, Response extends ActionResponse,
RequestBuilder extends ActionRequestBuilder<Request, Response, RequestBuilder>> void doExecute(
Action<Request, Response, RequestBuilder> action, Request request, ActionListener<Response> listener) {
in().execute(action, request, listener);
}
代码示例来源:origin: org.elasticsearch/elasticsearch
/**
* Executes an asynchronous persistent task action using the client.
* <p>
* The origin is set in the context and the listener is wrapped to ensure the proper context is restored
*/
private <Req extends ActionRequest, Resp extends PersistentTaskResponse, Builder extends ActionRequestBuilder<Req, Resp, Builder>>
void execute(final Req request, final Action<Req, Resp, Builder> action, final ActionListener<PersistentTask<?>> listener) {
try {
client.execute(action, request,
ActionListener.wrap(r -> listener.onResponse(r.getTask()), listener::onFailure));
} catch (Exception e) {
listener.onFailure(e);
}
}
代码示例来源:origin: spinscale/elasticsearch-suggest-plugin
@Override
protected void doExecute(ActionListener<SuggestStatisticsResponse> listener) {
client.execute(SuggestStatisticsAction.INSTANCE, request, listener);
}
}
代码示例来源:origin: com.github.tlrx/elasticsearch-view-plugin
@Override
protected void doExecute(ActionListener<ViewResponse> listener) {
((Client) client).execute(ViewAction.INSTANCE, request, listener);
}
}
代码示例来源:origin: crate/elasticsearch-inout-plugin
@Override
protected void doExecute(ActionListener<SearchIntoResponse> listener) {
((Client) client).execute(SearchIntoAction.INSTANCE, request,
listener);
}
代码示例来源:origin: crate/elasticsearch-inout-plugin
@Override
protected void doExecute(ActionListener<ImportResponse> listener) {
((Client) client).execute(ImportAction.INSTANCE, request, listener);
}
}
代码示例来源:origin: tlrx/elasticsearch-view-plugin
@Override
protected void doExecute(ActionListener<ViewResponse> listener) {
((Client) client).execute(ViewAction.INSTANCE, request, listener);
}
}
代码示例来源:origin: yakaz/elasticsearch-action-updatebyquery
@Override
public ActionFuture<UpdateByQueryResponse> updateByQuery(UpdateByQueryRequest request) {
return client.execute(UpdateByQueryAction.INSTANCE, request);
}
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.elasticsearch
@Override
protected <Request extends ActionRequest, Response extends ActionResponse, RequestBuilder extends ActionRequestBuilder<Request, Response, RequestBuilder>> void doExecute(
Action<Request, Response, RequestBuilder> action, Request request, ActionListener<Response> listener) {
in().execute(action, request, listener);
}
代码示例来源:origin: com.strapdata.elasticsearch/elasticsearch
@Override
protected <Request extends ActionRequest, Response extends ActionResponse, RequestBuilder extends ActionRequestBuilder<Request, Response, RequestBuilder>> void doExecute(
Action<Request, Response, RequestBuilder> action, Request request, ActionListener<Response> listener) {
in().execute(action, request, listener);
}
代码示例来源:origin: meltwater/elasticsearch-batch-percolator
@Override
protected void doExecute(ActionListener<BatchPercolateResponse> listener) {
if (sourceBuilder != null) {
request.source(sourceBuilder);
}
client.execute(BatchPercolateAction.INSTANCE, request, listener);
}
代码示例来源:origin: harbby/presto-connectors
@Override
protected <Request extends ActionRequest, Response extends ActionResponse, RequestBuilder extends ActionRequestBuilder<Request, Response, RequestBuilder>> void doExecute(Action<Request, Response, RequestBuilder> action, Request request, ActionListener<Response> listener) {
in().execute(action, request, listener);
}
代码示例来源:origin: apache/metron
public static void waitForCluster(Client client, ClusterHealthStatus statusThreshold,
String timeout) throws UnableToStartException {
try {
ClusterHealthResponse healthResponse = (ClusterHealthResponse) client
.execute(ClusterHealthAction.INSTANCE,
new ClusterHealthRequest().waitForStatus(statusThreshold).timeout(timeout))
.actionGet();
if (healthResponse != null && healthResponse.isTimedOut()) {
throw new UnableToStartException("cluster state is " + healthResponse.getStatus().name()
+ " and not " + statusThreshold.name()
+ ", from here on, everything will fail!");
}
} catch (ElasticsearchTimeoutException e) {
throw new UnableToStartException(
"timeout, cluster does not respond to health request, cowardly refusing to continue with operations");
}
}
代码示例来源:origin: sirensolutions/siren-join
@Override
protected void handleRequest(RestRequest request, RestChannel channel, Client client) throws Exception {
ClearFilterJoinCacheRequest clearFilterJoinCacheRequest = new ClearFilterJoinCacheRequest();
client.execute(ClearFilterJoinCacheAction.INSTANCE, clearFilterJoinCacheRequest, new RestToXContentListener<ClearFilterJoinCacheResponse>(channel));
}
代码示例来源:origin: sirensolutions/siren-join
@Override
protected void handleRequest(RestRequest request, RestChannel channel, Client client) throws Exception {
StatsFilterJoinCacheRequest statsFilterJoinCacheRequest = new StatsFilterJoinCacheRequest();
client.execute(StatsFilterJoinCacheAction.INSTANCE, statsFilterJoinCacheRequest, new RestToXContentListener<StatsFilterJoinCacheResponse>(channel));
}
代码示例来源:origin: spinscale/elasticsearch-suggest-plugin
@Override
public void handleRequest(final RestRequest request, final RestChannel channel, Client client) {
client.execute(SuggestStatisticsAction.INSTANCE, new SuggestStatisticsRequest(),
new RestToXContentListener<SuggestStatisticsResponse>(channel));
}
}
代码示例来源:origin: sirensolutions/siren-join
@Override
public void handleRequest(final RestRequest request, final RestChannel channel, final Client client) {
SearchRequest searchRequest = new SearchRequest();
RestSearchAction.parseSearchRequest(searchRequest, request, parseFieldMatcher, null);
client.execute(CoordinateSearchAction.INSTANCE, searchRequest, new RestStatusToXContentListener<SearchResponse>(channel));
}
代码示例来源:origin: meltwater/elasticsearch-batch-percolator
@Override
public void handleRequest(final RestRequest restRequest, final RestChannel restChannel, final Client client) throws Exception {
BatchPercolateRequest percolateRequest = new BatchPercolateRequest();
percolateRequest.indicesOptions(IndicesOptions.fromRequest(restRequest, percolateRequest.indicesOptions()));
percolateRequest.indices(Strings.splitStringByCommaToArray(restRequest.param("index")));
percolateRequest.documentType(restRequest.param("type"));
percolateRequest.documentType(percolateRequest.getDocumentType());
percolateRequest.source(RestActions.getRestContent(restRequest));
client.execute(BatchPercolateAction.INSTANCE, percolateRequest, new RestToXContentListener<BatchPercolateResponse>(restChannel));
}
}
代码示例来源:origin: sirensolutions/siren-join
@Override
public void handleRequest(final RestRequest request, final RestChannel channel, final Client client) throws Exception {
MultiSearchRequest multiSearchRequest = new MultiSearchRequest();
String[] indices = Strings.splitStringByCommaToArray(request.param("index"));
String[] types = Strings.splitStringByCommaToArray(request.param("type"));
String path = request.path();
boolean isTemplateRequest = isTemplateRequest(path);
IndicesOptions indicesOptions = IndicesOptions.fromRequest(request, multiSearchRequest.indicesOptions());
multiSearchRequest.add(RestActions.getRestContent(request), isTemplateRequest, indices, types, request.param("search_type"), request.param("routing"), indicesOptions, allowExplicitIndex);
client.execute(CoordinateMultiSearchAction.INSTANCE, multiSearchRequest, new RestToXContentListener<MultiSearchResponse>(channel));
}
内容来源于网络,如有侵权,请联系作者删除!