Class RestHighLevelClient
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable
public class RestHighLevelClient
extends java.lang.Object
implements java.io.Closeable
RestClient and allows to build requests and read responses. The
RestClient instance is internally built based on the provided RestClientBuilder and it gets closed automatically when
closing the RestHighLevelClient instance that wraps it.
In case an already existing instance of a low-level REST client needs to be provided, this class can be subclassed and the
RestHighLevelClient(RestClient, CheckedConsumer, List) constructor can be used.
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.
The majority of the methods in this class come in two flavors, a blocking and an asynchronous version (e.g.
search(SearchRequest, RequestOptions) and searchAsync(SearchRequest, RequestOptions, ActionListener), where the later
takes an implementation of an ActionListener as an argument that needs to implement methods that handle successful responses and
failure scenarios. Most of the blocking calls can throw an IOException or an unchecked ElasticsearchException in the
following cases:
- an
IOExceptionis 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 - an
ElasticsearchExceptionis 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 ElasticsearchException and suppresses the originalResponseException
-
Constructor Summary
Constructors Modifier Constructor Description RestHighLevelClient(RestClientBuilder restClientBuilder)Creates aRestHighLevelClientgiven the low levelRestClientBuilderthat allows to build theRestClientto be used to perform requests.protectedRestHighLevelClient(RestClientBuilder restClientBuilder, java.util.List<NamedXContentRegistry.Entry> namedXContentEntries)Creates aRestHighLevelClientgiven the low levelRestClientBuilderthat allows to build theRestClientto be used to perform requests and parsers for custom response sections added to Elasticsearch through plugins.protectedRestHighLevelClient(RestClient restClient, CheckedConsumer<RestClient,java.io.IOException> doClose, java.util.List<NamedXContentRegistry.Entry> namedXContentEntries)Creates aRestHighLevelClientgiven the low levelRestClientthat it should use to perform requests and a list of entries that allow to parse custom response sections added to Elasticsearch through plugins. -
Method Summary
Modifier and Type Method Description AsyncSearchClientasyncSearch()A wrapper for theRestHighLevelClientthat provides methods for accessing the Elastic Index Async Search APIs.BulkResponsebulk(BulkRequest bulkRequest, RequestOptions options)Executes a bulk request using the Bulk API.CancellablebulkAsync(BulkRequest bulkRequest, RequestOptions options, ActionListener<BulkResponse> listener)Asynchronously executes a bulk request using the Bulk API.CcrClientccr()Provides methods for accessing the Elastic Licensed CCR APIs that are shipped with the Elastic Stack distribution of Elasticsearch.ClearScrollResponseclearScroll(ClearScrollRequest clearScrollRequest, RequestOptions options)Clears one or more scroll ids using the Clear Scroll API.CancellableclearScrollAsync(ClearScrollRequest clearScrollRequest, RequestOptions options, ActionListener<ClearScrollResponse> listener)Asynchronously clears one or more scroll ids using the Clear Scroll API.voidclose()ClusterClientcluster()Provides aClusterClientwhich can be used to access the Cluster API.protected static booleanconvertExistsResponse(Response response)CountResponsecount(CountRequest countRequest, RequestOptions options)Executes a count request using the Count API.CancellablecountAsync(CountRequest countRequest, RequestOptions options, ActionListener<CountResponse> listener)Asynchronously executes a count request using the Count API.DeleteResponsedelete(DeleteRequest deleteRequest, RequestOptions options)Deletes a document by id using the Delete API.CancellabledeleteAsync(DeleteRequest deleteRequest, RequestOptions options, ActionListener<DeleteResponse> listener)Asynchronously deletes a document by id using the Delete API.BulkByScrollResponsedeleteByQuery(DeleteByQueryRequest deleteByQueryRequest, RequestOptions options)Executes a delete by query request.CancellabledeleteByQueryAsync(DeleteByQueryRequest deleteByQueryRequest, RequestOptions options, ActionListener<BulkByScrollResponse> listener)Asynchronously executes a delete by query request.ListTasksResponsedeleteByQueryRethrottle(RethrottleRequest rethrottleRequest, RequestOptions options)Executes a delete by query rethrottle request.CancellabledeleteByQueryRethrottleAsync(RethrottleRequest rethrottleRequest, RequestOptions options, ActionListener<ListTasksResponse> listener)Asynchronously execute an delete by query rethrottle request.AcknowledgedResponsedeleteScript(DeleteStoredScriptRequest request, RequestOptions options)Delete stored script by id.CancellabledeleteScriptAsync(DeleteStoredScriptRequest request, RequestOptions options, ActionListener<AcknowledgedResponse> listener)Asynchronously delete stored script by id.EnrichClientenrich()EqlClienteql()Provides methods for accessing the Elastic EQL APIs that are shipped with the Elastic Stack distribution of Elasticsearch.booleanexists(GetRequest getRequest, RequestOptions options)Checks for the existence of a document.CancellableexistsAsync(GetRequest getRequest, RequestOptions options, ActionListener<java.lang.Boolean> listener)Asynchronously checks for the existence of a document.booleanexistsSource(GetRequest getRequest, RequestOptions options)Deprecated.useexistsSource(GetSourceRequest, RequestOptions)insteadbooleanexistsSource(GetSourceRequest getSourceRequest, RequestOptions options)Checks for the existence of a document with a "_source" field.CancellableexistsSourceAsync(GetRequest getRequest, RequestOptions options, ActionListener<java.lang.Boolean> listener)Deprecated.CancellableexistsSourceAsync(GetSourceRequest getSourceRequest, RequestOptions options, ActionListener<java.lang.Boolean> listener)Asynchronously checks for the existence of a document with a "_source" field.ExplainResponseexplain(ExplainRequest explainRequest, RequestOptions options)Executes a request using the Explain API.CancellableexplainAsync(ExplainRequest explainRequest, RequestOptions options, ActionListener<ExplainResponse> listener)Asynchronously executes a request using the Explain API.FieldCapabilitiesResponsefieldCaps(FieldCapabilitiesRequest fieldCapabilitiesRequest, RequestOptions options)Executes a request using the Field Capabilities API.CancellablefieldCapsAsync(FieldCapabilitiesRequest fieldCapabilitiesRequest, RequestOptions options, ActionListener<FieldCapabilitiesResponse> listener)Asynchronously executes a request using the Field Capabilities API.GetResponseget(GetRequest getRequest, RequestOptions options)Retrieves a document by id using the Get API.CancellablegetAsync(GetRequest getRequest, RequestOptions options, ActionListener<GetResponse> listener)Asynchronously retrieves a document by id using the Get API.RestClientgetLowLevelClient()Returns the low-level client that the current high-level client instance is using to perform requestsGetStoredScriptResponsegetScript(GetStoredScriptRequest request, RequestOptions options)Get stored script by id.CancellablegetScriptAsync(GetStoredScriptRequest request, RequestOptions options, ActionListener<GetStoredScriptResponse> listener)Asynchronously get stored script by id.GetSourceResponsegetSource(GetSourceRequest getSourceRequest, RequestOptions options)Retrieves the source field only of a document using GetSource API.CancellablegetSourceAsync(GetSourceRequest getSourceRequest, RequestOptions options, ActionListener<GetSourceResponse> listener)Asynchronously retrieves the source field only of a document using GetSource API.GraphClientgraph()Provides methods for accessing the Elastic Licensed Graph explore API that is shipped with the default distribution of Elasticsearch.IndexResponseindex(IndexRequest indexRequest, RequestOptions options)Index a document using the Index API.CancellableindexAsync(IndexRequest indexRequest, RequestOptions options, ActionListener<IndexResponse> listener)Asynchronously index a document using the Index API.IndexLifecycleClientindexLifecycle()A wrapper for theRestHighLevelClientthat provides methods for accessing the Elastic Index Lifecycle APIs.IndicesClientindices()Provides anIndicesClientwhich can be used to access the Indices API.MainResponseinfo(RequestOptions options)Get the cluster info otherwise provided when sending an HTTP request to '/'IngestClientingest()Provides aIngestClientwhich can be used to access the Ingest API.LicenseClientlicense()Provides methods for accessing the Elastic Licensed Licensing APIs that are shipped with the default distribution of Elasticsearch.MachineLearningClientmachineLearning()Provides methods for accessing the Elastic Licensed Machine Learning APIs that are shipped with the Elastic Stack distribution of Elasticsearch.MultiGetResponsemget(MultiGetRequest multiGetRequest, RequestOptions options)Retrieves multiple documents by id using the Multi Get API.CancellablemgetAsync(MultiGetRequest multiGetRequest, RequestOptions options, ActionListener<MultiGetResponse> listener)Asynchronously retrieves multiple documents by id using the Multi Get API.MigrationClientmigration()Provides methods for accessing the Elastic Licensed Migration APIs that are shipped with the default distribution of Elasticsearch.MultiSearchResponsemsearch(MultiSearchRequest multiSearchRequest, RequestOptions options)Executes a multi search using the msearch API.CancellablemsearchAsync(MultiSearchRequest searchRequest, RequestOptions options, ActionListener<MultiSearchResponse> listener)Asynchronously executes a multi search using the msearch API.MultiSearchTemplateResponsemsearchTemplate(MultiSearchTemplateRequest multiSearchTemplateRequest, RequestOptions options)Executes a request using the Multi Search Template API.CancellablemsearchTemplateAsync(MultiSearchTemplateRequest multiSearchTemplateRequest, RequestOptions options, ActionListener<MultiSearchTemplateResponse> listener)Asynchronously executes a request using the Multi Search Template API See Multi Search Template API on elastic.co.MultiTermVectorsResponsemtermvectors(MultiTermVectorsRequest request, RequestOptions options)Calls the Multi Term Vectors API See Multi Term Vectors API on elastic.coCancellablemtermvectorsAsync(MultiTermVectorsRequest request, RequestOptions options, ActionListener<MultiTermVectorsResponse> listener)Asynchronously calls the Multi Term Vectors API See Multi Term Vectors API on elastic.coMultiGetResponsemultiGet(MultiGetRequest multiGetRequest, RequestOptions options)Deprecated.usemget(MultiGetRequest, RequestOptions)insteadCancellablemultiGetAsync(MultiGetRequest multiGetRequest, RequestOptions options, ActionListener<MultiGetResponse> listener)Deprecated.MultiSearchResponsemultiSearch(MultiSearchRequest multiSearchRequest, RequestOptions options)Deprecated.usemsearch(MultiSearchRequest, RequestOptions)insteadCancellablemultiSearchAsync(MultiSearchRequest searchRequest, RequestOptions options, ActionListener<MultiSearchResponse> listener)Deprecated.protected <Resp> RespparseEntity(org.apache.http.HttpEntity entity, CheckedFunction<XContentParser,Resp,java.io.IOException> entityParser)protected ElasticsearchStatusExceptionparseResponseException(ResponseException responseException)Converts aResponseExceptionobtained from the low level REST client into anElasticsearchException.protected <Req extends ActionRequest, Resp>
RespperformRequest(Req request, CheckedFunction<Req,Request,java.io.IOException> requestConverter, RequestOptions options, CheckedFunction<Response,Resp,java.io.IOException> responseConverter, java.util.Set<java.lang.Integer> ignores)Deprecated.If creating a new HLRC ReST API call, consider creating new actions instead of reusing server actions.protected <Req extends ActionRequest, Resp>
RespperformRequestAndParseEntity(Req request, CheckedFunction<Req,Request,java.io.IOException> requestConverter, RequestOptions options, CheckedFunction<XContentParser,Resp,java.io.IOException> entityParser, java.util.Set<java.lang.Integer> ignores)Deprecated.If creating a new HLRC ReST API call, consider creating new actions instead of reusing server actions.protected <Req extends Validatable, Resp>
java.util.Optional<Resp>performRequestAndParseOptionalEntity(Req request, CheckedFunction<Req,Request,java.io.IOException> requestConverter, RequestOptions options, CheckedFunction<XContentParser,Resp,java.io.IOException> entityParser)Defines a helper method for requests that can 404 and in which case will return an empty Optional otherwise tries to parse the response bodyprotected <Req extends ActionRequest, Resp>
CancellableperformRequestAsync(Req request, CheckedFunction<Req,Request,java.io.IOException> requestConverter, RequestOptions options, CheckedFunction<Response,Resp,java.io.IOException> responseConverter, ActionListener<Resp> listener, java.util.Set<java.lang.Integer> ignores)Deprecated.If creating a new HLRC ReST API call, consider creating new actions instead of reusing server actions.protected <Req extends ActionRequest, Resp>
CancellableperformRequestAsyncAndParseEntity(Req request, CheckedFunction<Req,Request,java.io.IOException> requestConverter, RequestOptions options, CheckedFunction<XContentParser,Resp,java.io.IOException> entityParser, ActionListener<Resp> listener, java.util.Set<java.lang.Integer> ignores)Deprecated.If creating a new HLRC ReST API call, consider creating new actions instead of reusing server actions.protected <Req extends Validatable, Resp>
CancellableperformRequestAsyncAndParseOptionalEntity(Req request, CheckedFunction<Req,Request,java.io.IOException> requestConverter, RequestOptions options, CheckedFunction<XContentParser,Resp,java.io.IOException> entityParser, ActionListener<java.util.Optional<Resp>> listener)Asynchronous request which returns emptyOptionals in the case of 404s or parses entity into an Optionalbooleanping(RequestOptions options)Pings the remote Elasticsearch cluster and returns true if the ping succeeded, false otherwiseAcknowledgedResponseputScript(PutStoredScriptRequest putStoredScriptRequest, RequestOptions options)Puts an stored script using the Scripting API.CancellableputScriptAsync(PutStoredScriptRequest putStoredScriptRequest, RequestOptions options, ActionListener<AcknowledgedResponse> listener)Asynchronously puts an stored script using the Scripting API.RankEvalResponserankEval(RankEvalRequest rankEvalRequest, RequestOptions options)Executes a request using the Ranking Evaluation API.CancellablerankEvalAsync(RankEvalRequest rankEvalRequest, RequestOptions options, ActionListener<RankEvalResponse> listener)Asynchronously executes a request using the Ranking Evaluation API.BulkByScrollResponsereindex(ReindexRequest reindexRequest, RequestOptions options)Executes a reindex request.CancellablereindexAsync(ReindexRequest reindexRequest, RequestOptions options, ActionListener<BulkByScrollResponse> listener)Asynchronously executes a reindex request.ListTasksResponsereindexRethrottle(RethrottleRequest rethrottleRequest, RequestOptions options)Executes a reindex rethrottling request.CancellablereindexRethrottleAsync(RethrottleRequest rethrottleRequest, RequestOptions options, ActionListener<ListTasksResponse> listener)Executes a reindex rethrottling request.RollupClientrollup()Provides methods for accessing the Elastic Licensed Rollup APIs that are shipped with the default distribution of Elasticsearch.SearchResponsescroll(SearchScrollRequest searchScrollRequest, RequestOptions options)Executes a search using the Search Scroll API.CancellablescrollAsync(SearchScrollRequest searchScrollRequest, RequestOptions options, ActionListener<SearchResponse> listener)Asynchronously executes a search using the Search Scroll API.SearchResponsesearch(SearchRequest searchRequest, RequestOptions options)Executes a search request using the Search API.CancellablesearchAsync(SearchRequest searchRequest, RequestOptions options, ActionListener<SearchResponse> listener)Asynchronously executes a search using the Search API.SearchResponsesearchScroll(SearchScrollRequest searchScrollRequest, RequestOptions options)Deprecated.usescroll(SearchScrollRequest, RequestOptions)insteadCancellablesearchScrollAsync(SearchScrollRequest searchScrollRequest, RequestOptions options, ActionListener<SearchResponse> listener)Deprecated.SearchTemplateResponsesearchTemplate(SearchTemplateRequest searchTemplateRequest, RequestOptions options)Executes a request using the Search Template API.CancellablesearchTemplateAsync(SearchTemplateRequest searchTemplateRequest, RequestOptions options, ActionListener<SearchTemplateResponse> listener)Asynchronously executes a request using the Search Template API.SecurityClientsecurity()Provides methods for accessing the Elastic Licensed Security APIs that are shipped with the Elastic Stack distribution of Elasticsearch.SnapshotClientsnapshot()Provides aSnapshotClientwhich can be used to access the Snapshot API.TaskSubmissionResponsesubmitDeleteByQueryTask(DeleteByQueryRequest deleteByQueryRequest, RequestOptions options)Submits a delete by query task See Delete By Query API on elastic.coTaskSubmissionResponsesubmitReindexTask(ReindexRequest reindexRequest, RequestOptions options)Submits a reindex task.TasksClienttasks()Provides aTasksClientwhich can be used to access the Tasks API.TermVectorsResponsetermvectors(TermVectorsRequest request, RequestOptions options)Calls the Term Vectors API See Term Vectors API on elastic.coCancellabletermvectorsAsync(TermVectorsRequest request, RequestOptions options, ActionListener<TermVectorsResponse> listener)Asynchronously calls the Term Vectors API See Term Vectors API on elastic.coTransformClienttransform()Provides methods for accessing the Elastic Licensed Data Frame APIs that are shipped with the Elastic Stack distribution of Elasticsearch.UpdateResponseupdate(UpdateRequest updateRequest, RequestOptions options)Updates a document using the Update API.CancellableupdateAsync(UpdateRequest updateRequest, RequestOptions options, ActionListener<UpdateResponse> listener)Asynchronously updates a document using the Update API.BulkByScrollResponseupdateByQuery(UpdateByQueryRequest updateByQueryRequest, RequestOptions options)Executes a update by query request.CancellableupdateByQueryAsync(UpdateByQueryRequest updateByQueryRequest, RequestOptions options, ActionListener<BulkByScrollResponse> listener)Asynchronously executes an update by query request.ListTasksResponseupdateByQueryRethrottle(RethrottleRequest rethrottleRequest, RequestOptions options)Executes a update by query rethrottle request.CancellableupdateByQueryRethrottleAsync(RethrottleRequest rethrottleRequest, RequestOptions options, ActionListener<ListTasksResponse> listener)Asynchronously execute an update by query rethrottle request.WatcherClientwatcher()Provides methods for accessing the Elastic Licensed Watcher APIs that are shipped with the default distribution of Elasticsearch.XPackClientxpack()Provides methods for accessing the Elastic Licensed X-Pack Info and Usage APIs that are shipped with the default distribution of Elasticsearch.
-
Constructor Details
-
RestHighLevelClient
Creates aRestHighLevelClientgiven the low levelRestClientBuilderthat allows to build theRestClientto be used to perform requests. -
RestHighLevelClient
protected RestHighLevelClient(RestClientBuilder restClientBuilder, java.util.List<NamedXContentRegistry.Entry> namedXContentEntries)Creates aRestHighLevelClientgiven the low levelRestClientBuilderthat allows to build theRestClientto be used to perform requests and parsers for custom response sections added to Elasticsearch through plugins. -
RestHighLevelClient
protected RestHighLevelClient(RestClient restClient, CheckedConsumer<RestClient,java.io.IOException> doClose, java.util.List<NamedXContentRegistry.Entry> namedXContentEntries)Creates aRestHighLevelClientgiven the low levelRestClientthat it should use to perform requests and a list of entries that allow to parse custom response sections added to Elasticsearch 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 theclose()method is called. Also subclasses can provide parsers for custom response sections added to Elasticsearch through plugins.
-
-
Method Details
-
getLowLevelClient
Returns the low-level client that the current high-level client instance is using to perform requests -
close
public final void close() throws java.io.IOException- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Throws:
java.io.IOException
-
indices
Provides anIndicesClientwhich can be used to access the Indices API. See Indices API on elastic.co -
cluster
Provides aClusterClientwhich can be used to access the Cluster API. See Cluster API on elastic.co -
ingest
Provides aIngestClientwhich can be used to access the Ingest API. See Ingest API on elastic.co -
snapshot
Provides aSnapshotClientwhich can be used to access the Snapshot API. See Snapshot API on elastic.co -
rollup
Provides methods for accessing the Elastic Licensed Rollup APIs that are shipped with the default distribution of Elasticsearch. All of these APIs will 404 if run against the OSS distribution of Elasticsearch.See the Watcher APIs on elastic.co for more information.
-
ccr
Provides methods for accessing the Elastic Licensed CCR APIs that are shipped with the Elastic Stack distribution of Elasticsearch. All of these APIs will 404 if run against the OSS distribution of Elasticsearch.See the CCR APIs on elastic.co for more information.
- Returns:
- the client wrapper for making CCR API calls
-
tasks
Provides aTasksClientwhich can be used to access the Tasks API. See Task Management API on elastic.co -
xpack
Provides methods for accessing the Elastic Licensed X-Pack Info and Usage APIs that are shipped with the default distribution of Elasticsearch. All of these APIs will 404 if run against the OSS distribution of Elasticsearch.See the Info APIs on elastic.co for more information.
-
watcher
Provides methods for accessing the Elastic Licensed Watcher APIs that are shipped with the default distribution of Elasticsearch. All of these APIs will 404 if run against the OSS distribution of Elasticsearch.See the Watcher APIs on elastic.co for more information.
-
graph
Provides methods for accessing the Elastic Licensed Graph explore API that is shipped with the default distribution of Elasticsearch. All of these APIs will 404 if run against the OSS distribution of Elasticsearch.See the Graph API on elastic.co for more information.
-
license
Provides methods for accessing the Elastic Licensed Licensing APIs that are shipped with the default distribution of Elasticsearch. All of these APIs will 404 if run against the OSS distribution of Elasticsearch.See the Licensing APIs on elastic.co for more information.
-
indexLifecycle
A wrapper for theRestHighLevelClientthat provides methods for accessing the Elastic Index Lifecycle APIs.See the X-Pack APIs on elastic.co for more information.
-
asyncSearch
A wrapper for theRestHighLevelClientthat provides methods for accessing the Elastic Index Async Search APIs.See the X-Pack APIs on elastic.co for more information.
-
migration
Provides methods for accessing the Elastic Licensed Migration APIs that are shipped with the default distribution of Elasticsearch. All of these APIs will 404 if run against the OSS distribution of Elasticsearch.See the Migration APIs on elastic.co for more information.
-
machineLearning
Provides methods for accessing the Elastic Licensed Machine Learning APIs that are shipped with the Elastic Stack distribution of Elasticsearch. All of these APIs will 404 if run against the OSS distribution of Elasticsearch.See the Machine Learning APIs on elastic.co for more information.
- Returns:
- the client wrapper for making Machine Learning API calls
-
security
Provides methods for accessing the Elastic Licensed Security APIs that are shipped with the Elastic Stack distribution of Elasticsearch. All of these APIs will 404 if run against the OSS distribution of Elasticsearch.See the Security APIs on elastic.co for more information.
- Returns:
- the client wrapper for making Security API calls
-
transform
Provides methods for accessing the Elastic Licensed Data Frame APIs that are shipped with the Elastic Stack distribution of Elasticsearch. All of these APIs will 404 if run against the OSS distribution of Elasticsearch.See the Transform APIs on elastic.co for more information.
- Returns:
- the client wrapper for making Data Frame API calls
-
enrich
-
eql
Provides methods for accessing the Elastic EQL APIs that are shipped with the Elastic Stack distribution of Elasticsearch. All of these APIs will 404 if run against the OSS distribution of Elasticsearch.See the EQL APIs on elastic.co for more information.
- Returns:
- the client wrapper for making Data Frame API calls
-
bulk
public final BulkResponse bulk(BulkRequest bulkRequest, RequestOptions options) throws java.io.IOExceptionExecutes a bulk request using the Bulk API. See Bulk API on elastic.co- Parameters:
bulkRequest- the requestoptions- the request options (e.g. headers), useRequestOptions.DEFAULTif nothing needs to be customized- Returns:
- the response
- Throws:
java.io.IOException
-
bulkAsync
public final Cancellable bulkAsync(BulkRequest bulkRequest, RequestOptions options, ActionListener<BulkResponse> listener)Asynchronously executes a bulk request using the Bulk API. See Bulk API on elastic.co- Parameters:
bulkRequest- the requestoptions- the request options (e.g. headers), useRequestOptions.DEFAULTif nothing needs to be customizedlistener- the listener to be notified upon request completion- Returns:
- cancellable that may be used to cancel the request
-
reindex
public final BulkByScrollResponse reindex(ReindexRequest reindexRequest, RequestOptions options) throws java.io.IOExceptionExecutes a reindex request. See Reindex API on elastic.co- Parameters:
reindexRequest- the requestoptions- the request options (e.g. headers), useRequestOptions.DEFAULTif nothing needs to be customized- Returns:
- the response
- Throws:
java.io.IOException
-
submitReindexTask
public final TaskSubmissionResponse submitReindexTask(ReindexRequest reindexRequest, RequestOptions options) throws java.io.IOExceptionSubmits a reindex task. See Reindex API on elastic.co- Parameters:
reindexRequest- the requestoptions- the request options (e.g. headers), useRequestOptions.DEFAULTif nothing needs to be customized- Returns:
- the submission response
- Throws:
java.io.IOException
-
reindexAsync
public final Cancellable reindexAsync(ReindexRequest reindexRequest, RequestOptions options, ActionListener<BulkByScrollResponse> listener)Asynchronously executes a reindex request. See Reindex API on elastic.co- Parameters:
reindexRequest- the requestoptions- the request options (e.g. headers), useRequestOptions.DEFAULTif nothing needs to be customizedlistener- the listener to be notified upon request completion- Returns:
- cancellable that may be used to cancel the request
-
updateByQuery
public final BulkByScrollResponse updateByQuery(UpdateByQueryRequest updateByQueryRequest, RequestOptions options) throws java.io.IOExceptionExecutes a update by query request. See Update By Query API on elastic.co- Parameters:
updateByQueryRequest- the requestoptions- the request options (e.g. headers), useRequestOptions.DEFAULTif nothing needs to be customized- Returns:
- the response
- Throws:
java.io.IOException
-
updateByQueryAsync
public final Cancellable updateByQueryAsync(UpdateByQueryRequest updateByQueryRequest, RequestOptions options, ActionListener<BulkByScrollResponse> listener)Asynchronously executes an update by query request. See Update By Query API on elastic.co- Parameters:
updateByQueryRequest- the requestoptions- the request options (e.g. headers), useRequestOptions.DEFAULTif nothing needs to be customizedlistener- the listener to be notified upon request completion- Returns:
- cancellable that may be used to cancel the request
-
deleteByQuery
public final BulkByScrollResponse deleteByQuery(DeleteByQueryRequest deleteByQueryRequest, RequestOptions options) throws java.io.IOExceptionExecutes a delete by query request. See Delete By Query API on elastic.co- Parameters:
deleteByQueryRequest- the requestoptions- the request options (e.g. headers), useRequestOptions.DEFAULTif nothing needs to be customized- Returns:
- the response
- Throws:
java.io.IOException
-
submitDeleteByQueryTask
public final TaskSubmissionResponse submitDeleteByQueryTask(DeleteByQueryRequest deleteByQueryRequest, RequestOptions options) throws java.io.IOExceptionSubmits a delete by query task See Delete By Query API on elastic.co- Parameters:
deleteByQueryRequest- the requestoptions- the request options (e.g. headers), useRequestOptions.DEFAULTif nothing needs to be customized- Returns:
- the submission response
- Throws:
java.io.IOException
-
deleteByQueryAsync
public final Cancellable deleteByQueryAsync(DeleteByQueryRequest deleteByQueryRequest, RequestOptions options, ActionListener<BulkByScrollResponse> listener)Asynchronously executes a delete by query request. See Delete By Query API on elastic.co- Parameters:
deleteByQueryRequest- the requestoptions- the request options (e.g. headers), useRequestOptions.DEFAULTif nothing needs to be customizedlistener- the listener to be notified upon request completion- Returns:
- cancellable that may be used to cancel the request
-
deleteByQueryRethrottle
public final ListTasksResponse deleteByQueryRethrottle(RethrottleRequest rethrottleRequest, RequestOptions options) throws java.io.IOExceptionExecutes a delete by query rethrottle request. See Delete By Query API on elastic.co- Parameters:
rethrottleRequest- the requestoptions- the request options (e.g. headers), useRequestOptions.DEFAULTif nothing needs to be customized- Returns:
- the response
- Throws:
java.io.IOException
-
deleteByQueryRethrottleAsync
public final Cancellable deleteByQueryRethrottleAsync(RethrottleRequest rethrottleRequest, RequestOptions options, ActionListener<ListTasksResponse> listener)Asynchronously execute an delete by query rethrottle request. See Delete By Query API on elastic.co- Parameters:
rethrottleRequest- the requestoptions- the request options (e.g. headers), useRequestOptions.DEFAULTif nothing needs to be customizedlistener- the listener to be notified upon request completion- Returns:
- cancellable that may be used to cancel the request
-
updateByQueryRethrottle
public final ListTasksResponse updateByQueryRethrottle(RethrottleRequest rethrottleRequest, RequestOptions options) throws java.io.IOExceptionExecutes a update by query rethrottle request. See Update By Query API on elastic.co- Parameters:
rethrottleRequest- the requestoptions- the request options (e.g. headers), useRequestOptions.DEFAULTif nothing needs to be customized- Returns:
- the response
- Throws:
java.io.IOException
-
updateByQueryRethrottleAsync
public final Cancellable updateByQueryRethrottleAsync(RethrottleRequest rethrottleRequest, RequestOptions options, ActionListener<ListTasksResponse> listener)Asynchronously execute an update by query rethrottle request. See Update By Query API on elastic.co- Parameters:
rethrottleRequest- the requestoptions- the request options (e.g. headers), useRequestOptions.DEFAULTif nothing needs to be customizedlistener- the listener to be notified upon request completion- Returns:
- cancellable that may be used to cancel the request
-
reindexRethrottle
public final ListTasksResponse reindexRethrottle(RethrottleRequest rethrottleRequest, RequestOptions options) throws java.io.IOExceptionExecutes a reindex rethrottling request. See the Reindex rethrottling API on elastic.co- Parameters:
rethrottleRequest- the requestoptions- the request options (e.g. headers), useRequestOptions.DEFAULTif nothing needs to be customized- Returns:
- the response
- Throws:
java.io.IOException
-
reindexRethrottleAsync
public final Cancellable reindexRethrottleAsync(RethrottleRequest rethrottleRequest, RequestOptions options, ActionListener<ListTasksResponse> listener)Executes a reindex rethrottling request. See the Reindex rethrottling API on elastic.co- Parameters:
rethrottleRequest- the requestoptions- the request options (e.g. headers), useRequestOptions.DEFAULTif nothing needs to be customizedlistener- the listener to be notified upon request completion- Returns:
- cancellable that may be used to cancel the request
-
ping
Pings the remote Elasticsearch cluster and returns true if the ping succeeded, false otherwise- Parameters:
options- the request options (e.g. headers), useRequestOptions.DEFAULTif nothing needs to be customized- Returns:
trueif the ping succeeded, false otherwise- Throws:
java.io.IOException
-
info
Get the cluster info otherwise provided when sending an HTTP request to '/'- Parameters:
options- the request options (e.g. headers), useRequestOptions.DEFAULTif nothing needs to be customized- Returns:
- the response
- Throws:
java.io.IOException
-
get
public final GetResponse get(GetRequest getRequest, RequestOptions options) throws java.io.IOExceptionRetrieves a document by id using the Get API. See Get API on elastic.co- Parameters:
getRequest- the requestoptions- the request options (e.g. headers), useRequestOptions.DEFAULTif nothing needs to be customized- Returns:
- the response
- Throws:
java.io.IOException
-
getAsync
public final Cancellable getAsync(GetRequest getRequest, RequestOptions options, ActionListener<GetResponse> listener)Asynchronously retrieves a document by id using the Get API. See Get API on elastic.co- Parameters:
getRequest- the requestoptions- the request options (e.g. headers), useRequestOptions.DEFAULTif nothing needs to be customizedlistener- the listener to be notified upon request completion- Returns:
- cancellable that may be used to cancel the request
-
multiGet
@Deprecated public final MultiGetResponse multiGet(MultiGetRequest multiGetRequest, RequestOptions options) throws java.io.IOExceptionDeprecated.usemget(MultiGetRequest, RequestOptions)insteadRetrieves multiple documents by id using the Multi Get API. See Multi Get API on elastic.co- Parameters:
multiGetRequest- the requestoptions- the request options (e.g. headers), useRequestOptions.DEFAULTif nothing needs to be customized- Returns:
- the response
- Throws:
java.io.IOException
-
mget
public final MultiGetResponse mget(MultiGetRequest multiGetRequest, RequestOptions options) throws java.io.IOExceptionRetrieves multiple documents by id using the Multi Get API. See Multi Get API on elastic.co- Parameters:
multiGetRequest- the requestoptions- the request options (e.g. headers), useRequestOptions.DEFAULTif nothing needs to be customized- Returns:
- the response
- Throws:
java.io.IOException
-
multiGetAsync
@Deprecated public final Cancellable multiGetAsync(MultiGetRequest multiGetRequest, RequestOptions options, ActionListener<MultiGetResponse> listener)Deprecated.Asynchronously retrieves multiple documents by id using the Multi Get API. See Multi Get API on elastic.co- Parameters:
multiGetRequest- the requestoptions- the request options (e.g. headers), useRequestOptions.DEFAULTif nothing needs to be customizedlistener- the listener to be notified upon request completion- Returns:
- cancellable that may be used to cancel the request
-
mgetAsync
public final Cancellable mgetAsync(MultiGetRequest multiGetRequest, RequestOptions options, ActionListener<MultiGetResponse> listener)Asynchronously retrieves multiple documents by id using the Multi Get API. See Multi Get API on elastic.co- Parameters:
multiGetRequest- the requestoptions- the request options (e.g. headers), useRequestOptions.DEFAULTif nothing needs to be customizedlistener- the listener to be notified upon request completion- Returns:
- cancellable that may be used to cancel the request
-
exists
public final boolean exists(GetRequest getRequest, RequestOptions options) throws java.io.IOExceptionChecks for the existence of a document. Returns true if it exists, false otherwise. See Get API on elastic.co- Parameters:
getRequest- the requestoptions- the request options (e.g. headers), useRequestOptions.DEFAULTif nothing needs to be customized- Returns:
trueif the document exists,falseotherwise- Throws:
java.io.IOException
-
existsAsync
public final Cancellable existsAsync(GetRequest getRequest, RequestOptions options, ActionListener<java.lang.Boolean> listener)Asynchronously checks for the existence of a document. Returns true if it exists, false otherwise. See Get API on elastic.co- Parameters:
getRequest- the requestoptions- the request options (e.g. headers), useRequestOptions.DEFAULTif nothing needs to be customizedlistener- the listener to be notified upon request completion- Returns:
- cancellable that may be used to cancel the request
-
existsSource
@Deprecated public boolean existsSource(GetRequest getRequest, RequestOptions options) throws java.io.IOExceptionDeprecated.useexistsSource(GetSourceRequest, RequestOptions)insteadChecks for the existence of a document with a "_source" field. Returns true if it exists, false otherwise. See Source exists API on elastic.co- Parameters:
getRequest- the requestoptions- the request options (e.g. headers), useRequestOptions.DEFAULTif nothing needs to be customized- Returns:
trueif the document and _source field exists,falseotherwise- Throws:
java.io.IOException
-
existsSourceAsync
@Deprecated public final Cancellable existsSourceAsync(GetRequest getRequest, RequestOptions options, ActionListener<java.lang.Boolean> listener)Deprecated.Asynchronously checks for the existence of a document with a "_source" field. Returns true if it exists, false otherwise. See Source exists API on elastic.co- Parameters:
getRequest- the requestoptions- the request options (e.g. headers), useRequestOptions.DEFAULTif nothing needs to be customizedlistener- the listener to be notified upon request completion- Returns:
- cancellable that may be used to cancel the request
-
existsSource
public boolean existsSource(GetSourceRequest getSourceRequest, RequestOptions options) throws java.io.IOExceptionChecks for the existence of a document with a "_source" field. Returns true if it exists, false otherwise. See Source exists API on elastic.co- Parameters:
getSourceRequest- the requestoptions- the request options (e.g. headers), useRequestOptions.DEFAULTif nothing needs to be customized- Returns:
trueif the document and _source field exists,falseotherwise- Throws:
java.io.IOException
-
existsSourceAsync
public final Cancellable existsSourceAsync(GetSourceRequest getSourceRequest, RequestOptions options, ActionListener<java.lang.Boolean> listener)Asynchronously checks for the existence of a document with a "_source" field. Returns true if it exists, false otherwise. See Source exists API on elastic.co- Parameters:
getSourceRequest- the requestoptions- the request options (e.g. headers), useRequestOptions.DEFAULTif nothing needs to be customizedlistener- the listener to be notified upon request completion- Returns:
- cancellable that may be used to cancel the request
-
getSource
public GetSourceResponse getSource(GetSourceRequest getSourceRequest, RequestOptions options) throws java.io.IOExceptionRetrieves the source field only of a document using GetSource API. See Get Source API on elastic.co- Parameters:
getSourceRequest- the requestoptions- the request options (e.g. headers), useRequestOptions.DEFAULTif nothing needs to be customized- Returns:
- the response
- Throws:
java.io.IOException
-
getSourceAsync
public final Cancellable getSourceAsync(GetSourceRequest getSourceRequest, RequestOptions options, ActionListener<GetSourceResponse> listener)Asynchronously retrieves the source field only of a document using GetSource API. See Get Source API on elastic.co- Parameters:
getSourceRequest- the requestoptions- the request options (e.g. headers), useRequestOptions.DEFAULTif nothing needs to be customizedlistener- the listener to be notified upon request completion- Returns:
- cancellable that may be used to cancel the request
-
index
public final IndexResponse index(IndexRequest indexRequest, RequestOptions options) throws java.io.IOExceptionIndex a document using the Index API. See Index API on elastic.co- Parameters:
indexRequest- the requestoptions- the request options (e.g. headers), useRequestOptions.DEFAULTif nothing needs to be customized- Returns:
- the response
- Throws:
java.io.IOException
-
indexAsync
public final Cancellable indexAsync(IndexRequest indexRequest, RequestOptions options, ActionListener<IndexResponse> listener)Asynchronously index a document using the Index API. See Index API on elastic.co- Parameters:
indexRequest- the requestoptions- the request options (e.g. headers), useRequestOptions.DEFAULTif nothing needs to be customizedlistener- the listener to be notified upon request completion- Returns:
- cancellable that may be used to cancel the request
-
count
public final CountResponse count(CountRequest countRequest, RequestOptions options) throws java.io.IOExceptionExecutes a count request using the Count API. See Count API on elastic.co- Parameters:
countRequest- the requestoptions- the request options (e.g. headers), useRequestOptions.DEFAULTif nothing needs to be customized- Returns:
- the response
- Throws:
java.io.IOException
-
countAsync
public final Cancellable countAsync(CountRequest countRequest, RequestOptions options, ActionListener<CountResponse> listener)Asynchronously executes a count request using the Count API. See Count API on elastic.co- Parameters:
countRequest- the requestoptions- the request options (e.g. headers), useRequestOptions.DEFAULTif nothing needs to be customizedlistener- the listener to be notified upon request completion- Returns:
- cancellable that may be used to cancel the request
-
update
public final UpdateResponse update(UpdateRequest updateRequest, RequestOptions options) throws java.io.IOExceptionUpdates a document using the Update API. See Update API on elastic.co- Parameters:
updateRequest- the requestoptions- the request options (e.g. headers), useRequestOptions.DEFAULTif nothing needs to be customized- Returns:
- the response
- Throws:
java.io.IOException
-
updateAsync
public final Cancellable updateAsync(UpdateRequest updateRequest, RequestOptions options, ActionListener<UpdateResponse> listener)Asynchronously updates a document using the Update API. See Update API on elastic.co- Parameters:
updateRequest- the requestoptions- the request options (e.g. headers), useRequestOptions.DEFAULTif nothing needs to be customizedlistener- the listener to be notified upon request completion- Returns:
- cancellable that may be used to cancel the request
-
delete
public final DeleteResponse delete(DeleteRequest deleteRequest, RequestOptions options) throws java.io.IOExceptionDeletes a document by id using the Delete API. See Delete API on elastic.co- Parameters:
deleteRequest- the requestoptions- the request options (e.g. headers), useRequestOptions.DEFAULTif nothing needs to be customized- Returns:
- the response
- Throws:
java.io.IOException
-
deleteAsync
public final Cancellable deleteAsync(DeleteRequest deleteRequest, RequestOptions options, ActionListener<DeleteResponse> listener)Asynchronously deletes a document by id using the Delete API. See Delete API on elastic.co- Parameters:
deleteRequest- the requestoptions- the request options (e.g. headers), useRequestOptions.DEFAULTif nothing needs to be customizedlistener- the listener to be notified upon request completion- Returns:
- cancellable that may be used to cancel the request
-
search
public final SearchResponse search(SearchRequest searchRequest, RequestOptions options) throws java.io.IOExceptionExecutes a search request using the Search API. See Search API on elastic.co- Parameters:
searchRequest- the requestoptions- the request options (e.g. headers), useRequestOptions.DEFAULTif nothing needs to be customized- Returns:
- the response
- Throws:
java.io.IOException
-
searchAsync
public final Cancellable searchAsync(SearchRequest searchRequest, RequestOptions options, ActionListener<SearchResponse> listener)Asynchronously executes a search using the Search API. See Search API on elastic.co- Parameters:
searchRequest- the requestoptions- the request options (e.g. headers), useRequestOptions.DEFAULTif nothing needs to be customizedlistener- the listener to be notified upon request completion- Returns:
- cancellable that may be used to cancel the request
-
multiSearch
@Deprecated public final MultiSearchResponse multiSearch(MultiSearchRequest multiSearchRequest, RequestOptions options) throws java.io.IOExceptionDeprecated.usemsearch(MultiSearchRequest, RequestOptions)insteadExecutes a multi search using the msearch API. See Multi search API on elastic.co- Parameters:
multiSearchRequest- the requestoptions- the request options (e.g. headers), useRequestOptions.DEFAULTif nothing needs to be customized- Returns:
- the response
- Throws:
java.io.IOException
-
msearch
public final MultiSearchResponse msearch(MultiSearchRequest multiSearchRequest, RequestOptions options) throws java.io.IOExceptionExecutes a multi search using the msearch API. See Multi search API on elastic.co- Parameters:
multiSearchRequest- the requestoptions- the request options (e.g. headers), useRequestOptions.DEFAULTif nothing needs to be customized- Returns:
- the response
- Throws:
java.io.IOException
-
multiSearchAsync
@Deprecated public final Cancellable multiSearchAsync(MultiSearchRequest searchRequest, RequestOptions options, ActionListener<MultiSearchResponse> listener)Deprecated.Asynchronously executes a multi search using the msearch API. See Multi search API on elastic.co- Parameters:
searchRequest- the requestoptions- the request options (e.g. headers), useRequestOptions.DEFAULTif nothing needs to be customizedlistener- the listener to be notified upon request completion- Returns:
- cancellable that may be used to cancel the request
-
msearchAsync
public final Cancellable msearchAsync(MultiSearchRequest searchRequest, RequestOptions options, ActionListener<MultiSearchResponse> listener)Asynchronously executes a multi search using the msearch API. See Multi search API on elastic.co- Parameters:
searchRequest- the requestoptions- the request options (e.g. headers), useRequestOptions.DEFAULTif nothing needs to be customizedlistener- the listener to be notified upon request completion- Returns:
- cancellable that may be used to cancel the request
-
searchScroll
@Deprecated public final SearchResponse searchScroll(SearchScrollRequest searchScrollRequest, RequestOptions options) throws java.io.IOExceptionDeprecated.usescroll(SearchScrollRequest, RequestOptions)insteadExecutes a search using the Search Scroll API. See Search Scroll API on elastic.co- Parameters:
searchScrollRequest- the requestoptions- the request options (e.g. headers), useRequestOptions.DEFAULTif nothing needs to be customized- Returns:
- the response
- Throws:
java.io.IOException
-
scroll
public final SearchResponse scroll(SearchScrollRequest searchScrollRequest, RequestOptions options) throws java.io.IOExceptionExecutes a search using the Search Scroll API. See Search Scroll API on elastic.co- Parameters:
searchScrollRequest- the requestoptions- the request options (e.g. headers), useRequestOptions.DEFAULTif nothing needs to be customized- Returns:
- the response
- Throws:
java.io.IOException
-
searchScrollAsync
@Deprecated public final Cancellable searchScrollAsync(SearchScrollRequest searchScrollRequest, RequestOptions options, ActionListener<SearchResponse> listener)Deprecated.Asynchronously executes a search using the Search Scroll API. See Search Scroll API on elastic.co- Parameters:
searchScrollRequest- the requestoptions- the request options (e.g. headers), useRequestOptions.DEFAULTif nothing needs to be customizedlistener- the listener to be notified upon request completion- Returns:
- cancellable that may be used to cancel the request
-
scrollAsync
public final Cancellable scrollAsync(SearchScrollRequest searchScrollRequest, RequestOptions options, ActionListener<SearchResponse> listener)Asynchronously executes a search using the Search Scroll API. See Search Scroll API on elastic.co- Parameters:
searchScrollRequest- the requestoptions- the request options (e.g. headers), useRequestOptions.DEFAULTif nothing needs to be customizedlistener- the listener to be notified upon request completion- Returns:
- cancellable that may be used to cancel the request
-
clearScroll
public final ClearScrollResponse clearScroll(ClearScrollRequest clearScrollRequest, RequestOptions options) throws java.io.IOExceptionClears one or more scroll ids using the Clear Scroll API. See Clear Scroll API on elastic.co- Parameters:
clearScrollRequest- the requestoptions- the request options (e.g. headers), useRequestOptions.DEFAULTif nothing needs to be customized- Returns:
- the response
- Throws:
java.io.IOException
-
clearScrollAsync
public final Cancellable clearScrollAsync(ClearScrollRequest clearScrollRequest, RequestOptions options, ActionListener<ClearScrollResponse> listener)Asynchronously clears one or more scroll ids using the Clear Scroll API. See Clear Scroll API on elastic.co- Parameters:
clearScrollRequest- the requestoptions- the request options (e.g. headers), useRequestOptions.DEFAULTif nothing needs to be customizedlistener- the listener to be notified upon request completion- Returns:
- cancellable that may be used to cancel the request
-
searchTemplate
public final SearchTemplateResponse searchTemplate(SearchTemplateRequest searchTemplateRequest, RequestOptions options) throws java.io.IOExceptionExecutes a request using the Search Template API. See Search Template API on elastic.co.- Parameters:
searchTemplateRequest- the requestoptions- the request options (e.g. headers), useRequestOptions.DEFAULTif nothing needs to be customized- Returns:
- the response
- Throws:
java.io.IOException
-
searchTemplateAsync
public final Cancellable searchTemplateAsync(SearchTemplateRequest searchTemplateRequest, RequestOptions options, ActionListener<SearchTemplateResponse> listener)Asynchronously executes a request using the Search Template API. See Search Template API on elastic.co.- Returns:
- cancellable that may be used to cancel the request
-
explain
public final ExplainResponse explain(ExplainRequest explainRequest, RequestOptions options) throws java.io.IOExceptionExecutes a request using the Explain API. See Explain API on elastic.co- Parameters:
explainRequest- the requestoptions- the request options (e.g. headers), useRequestOptions.DEFAULTif nothing needs to be customized- Returns:
- the response
- Throws:
java.io.IOException
-
explainAsync
public final Cancellable explainAsync(ExplainRequest explainRequest, RequestOptions options, ActionListener<ExplainResponse> listener)Asynchronously executes a request using the Explain API. See Explain API on elastic.co- Parameters:
explainRequest- the requestoptions- the request options (e.g. headers), useRequestOptions.DEFAULTif nothing needs to be customizedlistener- the listener to be notified upon request completion- Returns:
- cancellable that may be used to cancel the request
-
termvectors
public final TermVectorsResponse termvectors(TermVectorsRequest request, RequestOptions options) throws java.io.IOExceptionCalls the Term Vectors API See Term Vectors API on elastic.co- Parameters:
request- the requestoptions- the request options (e.g. headers), useRequestOptions.DEFAULTif nothing needs to be customized- Throws:
java.io.IOException
-
termvectorsAsync
public final Cancellable termvectorsAsync(TermVectorsRequest request, RequestOptions options, ActionListener<TermVectorsResponse> listener)Asynchronously calls the Term Vectors API See Term Vectors API on elastic.co- Parameters:
request- the requestoptions- the request options (e.g. headers), useRequestOptions.DEFAULTif nothing needs to be customizedlistener- the listener to be notified upon request completion- Returns:
- cancellable that may be used to cancel the request
-
mtermvectors
public final MultiTermVectorsResponse mtermvectors(MultiTermVectorsRequest request, RequestOptions options) throws java.io.IOExceptionCalls the Multi Term Vectors API See Multi Term Vectors API on elastic.co- Parameters:
request- the requestoptions- the request options (e.g. headers), useRequestOptions.DEFAULTif nothing needs to be customized- Throws:
java.io.IOException
-
mtermvectorsAsync
public final Cancellable mtermvectorsAsync(MultiTermVectorsRequest request, RequestOptions options, ActionListener<MultiTermVectorsResponse> listener)Asynchronously calls the Multi Term Vectors API See Multi Term Vectors API on elastic.co- Parameters:
request- the requestoptions- the request options (e.g. headers), useRequestOptions.DEFAULTif nothing needs to be customizedlistener- the listener to be notified upon request completion- Returns:
- cancellable that may be used to cancel the request
-
rankEval
public final RankEvalResponse rankEval(RankEvalRequest rankEvalRequest, RequestOptions options) throws java.io.IOExceptionExecutes a request using the Ranking Evaluation API. See Ranking Evaluation API on elastic.co- Parameters:
rankEvalRequest- the requestoptions- the request options (e.g. headers), useRequestOptions.DEFAULTif nothing needs to be customized- Returns:
- the response
- Throws:
java.io.IOException
-
msearchTemplate
public final MultiSearchTemplateResponse msearchTemplate(MultiSearchTemplateRequest multiSearchTemplateRequest, RequestOptions options) throws java.io.IOExceptionExecutes a request using the Multi Search Template API. See Multi Search Template API on elastic.co.- Throws:
java.io.IOException
-
msearchTemplateAsync
public final Cancellable msearchTemplateAsync(MultiSearchTemplateRequest multiSearchTemplateRequest, RequestOptions options, ActionListener<MultiSearchTemplateResponse> listener)Asynchronously executes a request using the Multi Search Template API See Multi Search Template API on elastic.co.- Returns:
- cancellable that may be used to cancel the request
-
rankEvalAsync
public final Cancellable rankEvalAsync(RankEvalRequest rankEvalRequest, RequestOptions options, ActionListener<RankEvalResponse> listener)Asynchronously executes a request using the Ranking Evaluation API. See Ranking Evaluation API on elastic.co- Parameters:
rankEvalRequest- the requestoptions- the request options (e.g. headers), useRequestOptions.DEFAULTif nothing needs to be customizedlistener- the listener to be notified upon request completion- Returns:
- cancellable that may be used to cancel the request
-
fieldCaps
public final FieldCapabilitiesResponse fieldCaps(FieldCapabilitiesRequest fieldCapabilitiesRequest, RequestOptions options) throws java.io.IOExceptionExecutes a request using the Field Capabilities API. See Field Capabilities API on elastic.co.- Parameters:
fieldCapabilitiesRequest- the requestoptions- the request options (e.g. headers), useRequestOptions.DEFAULTif nothing needs to be customized- Returns:
- the response
- Throws:
java.io.IOException
-
getScript
public GetStoredScriptResponse getScript(GetStoredScriptRequest request, RequestOptions options) throws java.io.IOExceptionGet stored script by id. See How to use scripts on elastic.co- Parameters:
request- the requestoptions- the request options (e.g. headers), useRequestOptions.DEFAULTif nothing needs to be customized- Returns:
- the response
- Throws:
java.io.IOException
-
getScriptAsync
public Cancellable getScriptAsync(GetStoredScriptRequest request, RequestOptions options, ActionListener<GetStoredScriptResponse> listener)Asynchronously get stored script by id. See How to use scripts on elastic.co- Parameters:
request- the requestoptions- the request options (e.g. headers), useRequestOptions.DEFAULTif nothing needs to be customizedlistener- the listener to be notified upon request completion- Returns:
- cancellable that may be used to cancel the request
-
deleteScript
public AcknowledgedResponse deleteScript(DeleteStoredScriptRequest request, RequestOptions options) throws java.io.IOExceptionDelete stored script by id. See How to use scripts on elastic.co- Parameters:
request- the requestoptions- the request options (e.g. headers), useRequestOptions.DEFAULTif nothing needs to be customized- Returns:
- the response
- Throws:
java.io.IOException
-
deleteScriptAsync
public Cancellable deleteScriptAsync(DeleteStoredScriptRequest request, RequestOptions options, ActionListener<AcknowledgedResponse> listener)Asynchronously delete stored script by id. See How to use scripts on elastic.co- Parameters:
request- the requestoptions- the request options (e.g. headers), useRequestOptions.DEFAULTif nothing needs to be customizedlistener- the listener to be notified upon request completion- Returns:
- cancellable that may be used to cancel the request
-
putScript
public AcknowledgedResponse putScript(PutStoredScriptRequest putStoredScriptRequest, RequestOptions options) throws java.io.IOExceptionPuts an stored script using the Scripting API. See Scripting API on elastic.co- Parameters:
putStoredScriptRequest- the requestoptions- the request options (e.g. headers), useRequestOptions.DEFAULTif nothing needs to be customized- Returns:
- the response
- Throws:
java.io.IOException
-
putScriptAsync
public Cancellable putScriptAsync(PutStoredScriptRequest putStoredScriptRequest, RequestOptions options, ActionListener<AcknowledgedResponse> listener)Asynchronously puts an stored script using the Scripting API. See Scripting API on elastic.co- Parameters:
putStoredScriptRequest- the requestoptions- the request options (e.g. headers), useRequestOptions.DEFAULTif nothing needs to be customizedlistener- the listener to be notified upon request completion- Returns:
- cancellable that may be used to cancel the request
-
fieldCapsAsync
public final Cancellable fieldCapsAsync(FieldCapabilitiesRequest fieldCapabilitiesRequest, RequestOptions options, ActionListener<FieldCapabilitiesResponse> listener)Asynchronously executes a request using the Field Capabilities API. See Field Capabilities API on elastic.co.- Parameters:
fieldCapabilitiesRequest- the requestoptions- the request options (e.g. headers), useRequestOptions.DEFAULTif nothing needs to be customizedlistener- the listener to be notified upon request completion- Returns:
- cancellable that may be used to cancel the request
-
performRequestAndParseEntity
@Deprecated protected final <Req extends ActionRequest, Resp> Resp performRequestAndParseEntity(Req request, CheckedFunction<Req,Request,java.io.IOException> requestConverter, RequestOptions options, CheckedFunction<XContentParser,Resp,java.io.IOException> entityParser, java.util.Set<java.lang.Integer> ignores) throws java.io.IOExceptionDeprecated.If creating a new HLRC ReST API call, consider creating new actions instead of reusing server actions. The Validation layer has been added to the ReST client, and requests should extendValidatableinstead ofActionRequest.- Throws:
java.io.IOException
-
performRequestAndParseEntity
protected final <Req extends Validatable, Resp> Resp performRequestAndParseEntity(Req request, CheckedFunction<Req,Request,java.io.IOException> requestConverter, RequestOptions options, CheckedFunction<XContentParser,Resp,java.io.IOException> entityParser, java.util.Set<java.lang.Integer> ignores) throws java.io.IOExceptionDefines a helper method for performing a request and then parsing the returned entity using the provided entityParser.- Throws:
java.io.IOException
-
performRequest
@Deprecated protected final <Req extends ActionRequest, Resp> Resp performRequest(Req request, CheckedFunction<Req,Request,java.io.IOException> requestConverter, RequestOptions options, CheckedFunction<Response,Resp,java.io.IOException> responseConverter, java.util.Set<java.lang.Integer> ignores) throws java.io.IOExceptionDeprecated.If creating a new HLRC ReST API call, consider creating new actions instead of reusing server actions. The Validation layer has been added to the ReST client, and requests should extendValidatableinstead ofActionRequest.- Throws:
java.io.IOException
-
performRequest
protected final <Req extends Validatable, Resp> Resp performRequest(Req request, CheckedFunction<Req,Request,java.io.IOException> requestConverter, RequestOptions options, CheckedFunction<Response,Resp,java.io.IOException> responseConverter, java.util.Set<java.lang.Integer> ignores) throws java.io.IOExceptionDefines a helper method for performing a request.- Throws:
java.io.IOException
-
performRequestAndParseOptionalEntity
protected final <Req extends Validatable, Resp> java.util.Optional<Resp> performRequestAndParseOptionalEntity(Req request, CheckedFunction<Req,Request,java.io.IOException> requestConverter, RequestOptions options, CheckedFunction<XContentParser,Resp,java.io.IOException> entityParser) throws java.io.IOExceptionDefines a helper method for requests that can 404 and in which case will return an empty Optional otherwise tries to parse the response body- Throws:
java.io.IOException
-
performRequestAsyncAndParseEntity
@Deprecated protected final <Req extends ActionRequest, Resp> Cancellable performRequestAsyncAndParseEntity(Req request, CheckedFunction<Req,Request,java.io.IOException> requestConverter, RequestOptions options, CheckedFunction<XContentParser,Resp,java.io.IOException> entityParser, ActionListener<Resp> listener, java.util.Set<java.lang.Integer> ignores)Deprecated.If creating a new HLRC ReST API call, consider creating new actions instead of reusing server actions. The Validation layer has been added to the ReST client, and requests should extendValidatableinstead ofActionRequest.- Returns:
- Cancellable instance that may be used to cancel the request
-
performRequestAsyncAndParseEntity
protected final <Req extends Validatable, Resp> Cancellable performRequestAsyncAndParseEntity(Req request, CheckedFunction<Req,Request,java.io.IOException> requestConverter, RequestOptions options, CheckedFunction<XContentParser,Resp,java.io.IOException> entityParser, ActionListener<Resp> listener, java.util.Set<java.lang.Integer> ignores)Defines a helper method for asynchronously performing a request.- Returns:
- Cancellable instance that may be used to cancel the request
-
performRequestAsync
@Deprecated protected final <Req extends ActionRequest, Resp> Cancellable performRequestAsync(Req request, CheckedFunction<Req,Request,java.io.IOException> requestConverter, RequestOptions options, CheckedFunction<Response,Resp,java.io.IOException> responseConverter, ActionListener<Resp> listener, java.util.Set<java.lang.Integer> ignores)Deprecated.If creating a new HLRC ReST API call, consider creating new actions instead of reusing server actions. The Validation layer has been added to the ReST client, and requests should extendValidatableinstead ofActionRequest.- Returns:
- Cancellable instance that may be used to cancel the request
-
performRequestAsync
protected final <Req extends Validatable, Resp> Cancellable performRequestAsync(Req request, CheckedFunction<Req,Request,java.io.IOException> requestConverter, RequestOptions options, CheckedFunction<Response,Resp,java.io.IOException> responseConverter, ActionListener<Resp> listener, java.util.Set<java.lang.Integer> ignores)Defines a helper method for asynchronously performing a request.- Returns:
- Cancellable instance that may be used to cancel the request
-
performRequestAsyncAndParseOptionalEntity
protected final <Req extends Validatable, Resp> Cancellable performRequestAsyncAndParseOptionalEntity(Req request, CheckedFunction<Req,Request,java.io.IOException> requestConverter, RequestOptions options, CheckedFunction<XContentParser,Resp,java.io.IOException> entityParser, ActionListener<java.util.Optional<Resp>> listener)Asynchronous request which returns emptyOptionals in the case of 404s or parses entity into an Optional- Returns:
- Cancellable instance that may be used to cancel the request
-
parseResponseException
protected final ElasticsearchStatusException parseResponseException(ResponseException responseException)Converts aResponseExceptionobtained from the low level REST client into anElasticsearchException. If a response body was returned, tries to parse it as an error returned from Elasticsearch. If no response body was returned or anything goes wrong while parsing the error, returns a newElasticsearchStatusExceptionthat wraps the originalResponseException. The potential exception obtained while parsing is added to the returned exception as a suppressed exception. This method is guaranteed to not throw any exception eventually thrown while parsing. -
parseEntity
protected final <Resp> Resp parseEntity(org.apache.http.HttpEntity entity, CheckedFunction<XContentParser,Resp,java.io.IOException> entityParser) throws java.io.IOException- Throws:
java.io.IOException
-
convertExistsResponse
-