Package org.opensearch.client.opensearch
Class OpenSearchClient
- java.lang.Object
-
- org.opensearch.client.ApiClient<OpenSearchTransport,OpenSearchClient>
-
- org.opensearch.client.opensearch.OpenSearchClient
-
public class OpenSearchClient extends ApiClient<OpenSearchTransport,OpenSearchClient>
Client for the namespace.
-
-
Field Summary
-
Fields inherited from class org.opensearch.client.ApiClient
transport, transportOptions
-
-
Constructor Summary
Constructors Constructor Description OpenSearchClient(OpenSearchTransport transport)OpenSearchClient(OpenSearchTransport transport, TransportOptions transportOptions)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BulkResponsebulk()Allows to perform multiple index/update/delete operations in a single request.BulkResponsebulk(java.util.function.Function<BulkRequest.Builder,ObjectBuilder<BulkRequest>> fn)Allows to perform multiple index/update/delete operations in a single request.BulkResponsebulk(BulkRequest request)Allows to perform multiple index/update/delete operations in a single request.OpenSearchCatClientcat()ClearScrollResponseclearScroll()Explicitly clears the search context for a scroll.ClearScrollResponseclearScroll(java.util.function.Function<ClearScrollRequest.Builder,ObjectBuilder<ClearScrollRequest>> fn)Explicitly clears the search context for a scroll.ClearScrollResponseclearScroll(ClearScrollRequest request)Explicitly clears the search context for a scroll.OpenSearchClusterClientcluster()CountResponsecount()Returns number of documents matching a query.CountResponsecount(java.util.function.Function<CountRequest.Builder,ObjectBuilder<CountRequest>> fn)Returns number of documents matching a query.CountResponsecount(CountRequest request)Returns number of documents matching a query.<TDocument>
CreateResponsecreate(java.util.function.Function<CreateRequest.Builder<TDocument>,ObjectBuilder<CreateRequest<TDocument>>> fn)Creates a new document in the index.<TDocument>
CreateResponsecreate(CreateRequest<TDocument> request)Creates a new document in the index.CreatePitResponsecreatePit(java.util.function.Function<CreatePitRequest.Builder,ObjectBuilder<CreatePitRequest>> fn)Provides low-level information about the disk utilization of a PIT by describing its Lucene segments.CreatePitResponsecreatePit(CreatePitRequest request)Provides low-level information about the disk utilization of a PIT by describing its Lucene segments.OpenSearchDanglingIndicesClientdanglingIndices()DeleteResponsedelete(java.util.function.Function<DeleteRequest.Builder,ObjectBuilder<DeleteRequest>> fn)Removes a document from the index.DeleteResponsedelete(DeleteRequest request)Removes a document from the index.DeleteByQueryResponsedeleteByQuery(java.util.function.Function<DeleteByQueryRequest.Builder,ObjectBuilder<DeleteByQueryRequest>> fn)Deletes documents matching the provided query.DeleteByQueryResponsedeleteByQuery(DeleteByQueryRequest request)Deletes documents matching the provided query.DeleteByQueryRethrottleResponsedeleteByQueryRethrottle(java.util.function.Function<DeleteByQueryRethrottleRequest.Builder,ObjectBuilder<DeleteByQueryRethrottleRequest>> fn)Changes the number of requests per second for a particular Delete By Query operation.DeleteByQueryRethrottleResponsedeleteByQueryRethrottle(DeleteByQueryRethrottleRequest request)Changes the number of requests per second for a particular Delete By Query operation.DeletePitResponsedeletePit(java.util.function.Function<DeletePitRequest.Builder,ObjectBuilder<DeletePitRequest>> fn)Delete Point In TimeDeletePitResponsedeletePit(DeletePitRequest request)Delete Point In TimeDeleteScriptResponsedeleteScript(java.util.function.Function<DeleteScriptRequest.Builder,ObjectBuilder<DeleteScriptRequest>> fn)Deletes a script.DeleteScriptResponsedeleteScript(DeleteScriptRequest request)Deletes a script.BooleanResponseexists(java.util.function.Function<ExistsRequest.Builder,ObjectBuilder<ExistsRequest>> fn)Returns information about whether a document exists in an index.BooleanResponseexists(ExistsRequest request)Returns information about whether a document exists in an index.BooleanResponseexistsSource(java.util.function.Function<ExistsSourceRequest.Builder,ObjectBuilder<ExistsSourceRequest>> fn)Returns information about whether a document source exists in an index.BooleanResponseexistsSource(ExistsSourceRequest request)Returns information about whether a document source exists in an index.<TDocument>
ExplainResponse<TDocument>explain(java.util.function.Function<ExplainRequest.Builder,ObjectBuilder<ExplainRequest>> fn, java.lang.Class<TDocument> tDocumentClass)Returns information about why a specific matches (or doesn't match) a query.<TDocument>
ExplainResponse<TDocument>explain(ExplainRequest request, java.lang.Class<TDocument> tDocumentClass)Returns information about why a specific matches (or doesn't match) a query.OpenSearchFeaturesClientfeatures()FieldCapsResponsefieldCaps()Returns the information about the capabilities of fields among multiple indices.FieldCapsResponsefieldCaps(java.util.function.Function<FieldCapsRequest.Builder,ObjectBuilder<FieldCapsRequest>> fn)Returns the information about the capabilities of fields among multiple indices.FieldCapsResponsefieldCaps(FieldCapsRequest request)Returns the information about the capabilities of fields among multiple indices.<TDocument>
GetResponse<TDocument>get(java.util.function.Function<GetRequest.Builder,ObjectBuilder<GetRequest>> fn, java.lang.Class<TDocument> tDocumentClass)Returns a document.<TDocument>
GetResponse<TDocument>get(GetRequest request, java.lang.Class<TDocument> tDocumentClass)Returns a document.GetScriptResponsegetScript(java.util.function.Function<GetScriptRequest.Builder,ObjectBuilder<GetScriptRequest>> fn)Returns a script.GetScriptResponsegetScript(GetScriptRequest request)Returns a script.GetScriptContextResponsegetScriptContext()Returns all script contexts.GetScriptLanguagesResponsegetScriptLanguages()Returns available script types, languages and contexts<TDocument>
GetSourceResponse<TDocument>getSource(java.util.function.Function<GetSourceRequest.Builder,ObjectBuilder<GetSourceRequest>> fn, java.lang.Class<TDocument> tDocumentClass)Returns the source of a document.<TDocument>
GetSourceResponse<TDocument>getSource(GetSourceRequest request, java.lang.Class<TDocument> tDocumentClass)Returns the source of a document.<TDocument>
IndexResponseindex(java.util.function.Function<IndexRequest.Builder<TDocument>,ObjectBuilder<IndexRequest<TDocument>>> fn)Creates or updates a document in an index.<TDocument>
IndexResponseindex(IndexRequest<TDocument> request)Creates or updates a document in an index.OpenSearchIndicesClientindices()InfoResponseinfo()Returns basic information about the cluster.OpenSearchIngestClientingest()ListAllPitResponselistAllPit()List all Point In Time<TDocument>
MgetResponse<TDocument>mget(java.util.function.Function<MgetRequest.Builder,ObjectBuilder<MgetRequest>> fn, java.lang.Class<TDocument> tDocumentClass)Allows to get multiple documents in one request.<TDocument>
MgetResponse<TDocument>mget(MgetRequest request, java.lang.Class<TDocument> tDocumentClass)Allows to get multiple documents in one request.<TDocument>
MsearchResponse<TDocument>msearch(java.util.function.Function<MsearchRequest.Builder,ObjectBuilder<MsearchRequest>> fn, java.lang.Class<TDocument> tDocumentClass)Allows to execute several search operations in one request.<TDocument>
MsearchResponse<TDocument>msearch(MsearchRequest request, java.lang.Class<TDocument> tDocumentClass)Allows to execute several search operations in one request.<TDocument>
MsearchTemplateResponse<TDocument>msearchTemplate(java.util.function.Function<MsearchTemplateRequest.Builder,ObjectBuilder<MsearchTemplateRequest>> fn, java.lang.Class<TDocument> tDocumentClass)Allows to execute several search template operations in one request.<TDocument>
MsearchTemplateResponse<TDocument>msearchTemplate(MsearchTemplateRequest request, java.lang.Class<TDocument> tDocumentClass)Allows to execute several search template operations in one request.MtermvectorsResponsemtermvectors()Returns multiple termvectors in one request.MtermvectorsResponsemtermvectors(java.util.function.Function<MtermvectorsRequest.Builder,ObjectBuilder<MtermvectorsRequest>> fn)Returns multiple termvectors in one request.MtermvectorsResponsemtermvectors(MtermvectorsRequest request)Returns multiple termvectors in one request.OpenSearchNodesClientnodes()BooleanResponseping()Returns whether the cluster is running.PutScriptResponseputScript(java.util.function.Function<PutScriptRequest.Builder,ObjectBuilder<PutScriptRequest>> fn)Creates or updates a script.PutScriptResponseputScript(PutScriptRequest request)Creates or updates a script.RankEvalResponserankEval(java.util.function.Function<RankEvalRequest.Builder,ObjectBuilder<RankEvalRequest>> fn)Allows to evaluate the quality of ranked search results over a set of typical search queriesRankEvalResponserankEval(RankEvalRequest request)Allows to evaluate the quality of ranked search results over a set of typical search queriesReindexResponsereindex()Allows to copy documents from one index to another, optionally filtering the source documents by a query, changing the destination index settings, or fetching the documents from a remote cluster.ReindexResponsereindex(java.util.function.Function<ReindexRequest.Builder,ObjectBuilder<ReindexRequest>> fn)Allows to copy documents from one index to another, optionally filtering the source documents by a query, changing the destination index settings, or fetching the documents from a remote cluster.ReindexResponsereindex(ReindexRequest request)Allows to copy documents from one index to another, optionally filtering the source documents by a query, changing the destination index settings, or fetching the documents from a remote cluster.ReindexRethrottleResponsereindexRethrottle(java.util.function.Function<ReindexRethrottleRequest.Builder,ObjectBuilder<ReindexRethrottleRequest>> fn)Changes the number of requests per second for a particular Reindex operation.ReindexRethrottleResponsereindexRethrottle(ReindexRethrottleRequest request)Changes the number of requests per second for a particular Reindex operation.RenderSearchTemplateResponserenderSearchTemplate()Allows to use the Mustache language to pre-render a search definition.RenderSearchTemplateResponserenderSearchTemplate(java.util.function.Function<RenderSearchTemplateRequest.Builder,ObjectBuilder<RenderSearchTemplateRequest>> fn)Allows to use the Mustache language to pre-render a search definition.RenderSearchTemplateResponserenderSearchTemplate(RenderSearchTemplateRequest request)Allows to use the Mustache language to pre-render a search definition.<TResult> ScriptsPainlessExecuteResponse<TResult>scriptsPainlessExecute(java.util.function.Function<ScriptsPainlessExecuteRequest.Builder,ObjectBuilder<ScriptsPainlessExecuteRequest>> fn, java.lang.Class<TResult> tResultClass)Allows an arbitrary script to be executed and a result to be returned<TResult> ScriptsPainlessExecuteResponse<TResult>scriptsPainlessExecute(ScriptsPainlessExecuteRequest request, java.lang.Class<TResult> tResultClass)Allows an arbitrary script to be executed and a result to be returned<TDocument>
ScrollResponse<TDocument>scroll(java.util.function.Function<ScrollRequest.Builder,ObjectBuilder<ScrollRequest>> fn, java.lang.Class<TDocument> tDocumentClass)Allows to retrieve a large numbers of results from a single search request.<TDocument>
ScrollResponse<TDocument>scroll(ScrollRequest request, java.lang.Class<TDocument> tDocumentClass)Allows to retrieve a large numbers of results from a single search request.<TDocument>
SearchResponse<TDocument>search(java.util.function.Function<SearchRequest.Builder,ObjectBuilder<SearchRequest>> fn, java.lang.Class<TDocument> tDocumentClass)Returns results matching a query.<TDocument>
SearchResponse<TDocument>search(SearchRequest request, java.lang.Class<TDocument> tDocumentClass)Returns results matching a query.SearchShardsResponsesearchShards()Returns information about the indices and shards that a search request would be executed against.SearchShardsResponsesearchShards(java.util.function.Function<SearchShardsRequest.Builder,ObjectBuilder<SearchShardsRequest>> fn)Returns information about the indices and shards that a search request would be executed against.SearchShardsResponsesearchShards(SearchShardsRequest request)Returns information about the indices and shards that a search request would be executed against.<TDocument>
SearchTemplateResponse<TDocument>searchTemplate(java.util.function.Function<SearchTemplateRequest.Builder,ObjectBuilder<SearchTemplateRequest>> fn, java.lang.Class<TDocument> tDocumentClass)Allows to use the Mustache language to pre-render a search definition.<TDocument>
SearchTemplateResponse<TDocument>searchTemplate(SearchTemplateRequest request, java.lang.Class<TDocument> tDocumentClass)Allows to use the Mustache language to pre-render a search definition.OpenSearchShutdownClientshutdown()OpenSearchSnapshotClientsnapshot()OpenSearchTasksClienttasks()TermsEnumResponsetermsEnum(java.util.function.Function<TermsEnumRequest.Builder,ObjectBuilder<TermsEnumRequest>> fn)The terms enum API can be used to discover terms in the index that begin with the provided string.TermsEnumResponsetermsEnum(TermsEnumRequest request)The terms enum API can be used to discover terms in the index that begin with the provided string.<TDocument>
TermvectorsResponsetermvectors(java.util.function.Function<TermvectorsRequest.Builder<TDocument>,ObjectBuilder<TermvectorsRequest<TDocument>>> fn)Returns information and statistics about terms in the fields of a particular document.<TDocument>
TermvectorsResponsetermvectors(TermvectorsRequest<TDocument> request)Returns information and statistics about terms in the fields of a particular document.<TDocument,TPartialDocument>
UpdateResponse<TDocument>update(java.util.function.Function<UpdateRequest.Builder<TDocument,TPartialDocument>,ObjectBuilder<UpdateRequest<TDocument,TPartialDocument>>> fn, java.lang.Class<TDocument> tDocumentClass)Updates a document with a script or partial document.<TDocument,TPartialDocument>
UpdateResponse<TDocument>update(UpdateRequest<TDocument,TPartialDocument> request, java.lang.Class<TDocument> tDocumentClass)Updates a document with a script or partial document.UpdateByQueryResponseupdateByQuery(java.util.function.Function<UpdateByQueryRequest.Builder,ObjectBuilder<UpdateByQueryRequest>> fn)Performs an update on every document in the index without changing the source, for example to pick up a mapping change.UpdateByQueryResponseupdateByQuery(UpdateByQueryRequest request)Performs an update on every document in the index without changing the source, for example to pick up a mapping change.UpdateByQueryRethrottleResponseupdateByQueryRethrottle(java.util.function.Function<UpdateByQueryRethrottleRequest.Builder,ObjectBuilder<UpdateByQueryRethrottleRequest>> fn)Changes the number of requests per second for a particular Update By Query operation.UpdateByQueryRethrottleResponseupdateByQueryRethrottle(UpdateByQueryRethrottleRequest request)Changes the number of requests per second for a particular Update By Query operation.OpenSearchClientwithTransportOptions(TransportOptions transportOptions)Creates a new client with some request options-
Methods inherited from class org.opensearch.client.ApiClient
_transport, _transportOptions, getDeserializer
-
-
-
-
Constructor Detail
-
OpenSearchClient
public OpenSearchClient(OpenSearchTransport transport)
-
OpenSearchClient
public OpenSearchClient(OpenSearchTransport transport, @Nullable TransportOptions transportOptions)
-
-
Method Detail
-
withTransportOptions
public OpenSearchClient withTransportOptions(@Nullable TransportOptions transportOptions)
Description copied from class:ApiClientCreates a new client with some request options- Specified by:
withTransportOptionsin classApiClient<OpenSearchTransport,OpenSearchClient>
-
cat
public OpenSearchCatClient cat()
-
cluster
public OpenSearchClusterClient cluster()
-
danglingIndices
public OpenSearchDanglingIndicesClient danglingIndices()
-
features
public OpenSearchFeaturesClient features()
-
indices
public OpenSearchIndicesClient indices()
-
ingest
public OpenSearchIngestClient ingest()
-
nodes
public OpenSearchNodesClient nodes()
-
shutdown
public OpenSearchShutdownClient shutdown()
-
snapshot
public OpenSearchSnapshotClient snapshot()
-
tasks
public OpenSearchTasksClient tasks()
-
bulk
public BulkResponse bulk(BulkRequest request) throws java.io.IOException, OpenSearchException
Allows to perform multiple index/update/delete operations in a single request.- Throws:
java.io.IOExceptionOpenSearchException
-
bulk
public final BulkResponse bulk(java.util.function.Function<BulkRequest.Builder,ObjectBuilder<BulkRequest>> fn) throws java.io.IOException, OpenSearchException
Allows to perform multiple index/update/delete operations in a single request.- Parameters:
fn- a function that initializes a builder to create theBulkRequest- Throws:
java.io.IOExceptionOpenSearchException
-
bulk
public BulkResponse bulk() throws java.io.IOException, OpenSearchException
Allows to perform multiple index/update/delete operations in a single request.- Throws:
java.io.IOExceptionOpenSearchException
-
clearScroll
public ClearScrollResponse clearScroll(ClearScrollRequest request) throws java.io.IOException, OpenSearchException
Explicitly clears the search context for a scroll.- Throws:
java.io.IOExceptionOpenSearchException
-
clearScroll
public final ClearScrollResponse clearScroll(java.util.function.Function<ClearScrollRequest.Builder,ObjectBuilder<ClearScrollRequest>> fn) throws java.io.IOException, OpenSearchException
Explicitly clears the search context for a scroll.- Parameters:
fn- a function that initializes a builder to create theClearScrollRequest- Throws:
java.io.IOExceptionOpenSearchException
-
clearScroll
public ClearScrollResponse clearScroll() throws java.io.IOException, OpenSearchException
Explicitly clears the search context for a scroll.- Throws:
java.io.IOExceptionOpenSearchException
-
count
public CountResponse count(CountRequest request) throws java.io.IOException, OpenSearchException
Returns number of documents matching a query.- Throws:
java.io.IOExceptionOpenSearchException
-
count
public final CountResponse count(java.util.function.Function<CountRequest.Builder,ObjectBuilder<CountRequest>> fn) throws java.io.IOException, OpenSearchException
Returns number of documents matching a query.- Parameters:
fn- a function that initializes a builder to create theCountRequest- Throws:
java.io.IOExceptionOpenSearchException
-
count
public CountResponse count() throws java.io.IOException, OpenSearchException
Returns number of documents matching a query.- Throws:
java.io.IOExceptionOpenSearchException
-
create
public <TDocument> CreateResponse create(CreateRequest<TDocument> request) throws java.io.IOException, OpenSearchException
Creates a new document in the index.Returns a 409 response when a document with a same ID already exists in the index.
- Throws:
java.io.IOExceptionOpenSearchException
-
create
public final <TDocument> CreateResponse create(java.util.function.Function<CreateRequest.Builder<TDocument>,ObjectBuilder<CreateRequest<TDocument>>> fn) throws java.io.IOException, OpenSearchException
Creates a new document in the index.Returns a 409 response when a document with a same ID already exists in the index.
- Parameters:
fn- a function that initializes a builder to create theCreateRequest- Throws:
java.io.IOExceptionOpenSearchException
-
createPit
public CreatePitResponse createPit(CreatePitRequest request) throws java.io.IOException, OpenSearchException
Provides low-level information about the disk utilization of a PIT by describing its Lucene segments.- Throws:
java.io.IOExceptionOpenSearchException
-
createPit
public final CreatePitResponse createPit(java.util.function.Function<CreatePitRequest.Builder,ObjectBuilder<CreatePitRequest>> fn) throws java.io.IOException, OpenSearchException
Provides low-level information about the disk utilization of a PIT by describing its Lucene segments.- Parameters:
fn- a function that initializes a builder to create theCreatePitRequest- Throws:
java.io.IOExceptionOpenSearchException
-
delete
public DeleteResponse delete(DeleteRequest request) throws java.io.IOException, OpenSearchException
Removes a document from the index.- Throws:
java.io.IOExceptionOpenSearchException
-
delete
public final DeleteResponse delete(java.util.function.Function<DeleteRequest.Builder,ObjectBuilder<DeleteRequest>> fn) throws java.io.IOException, OpenSearchException
Removes a document from the index.- Parameters:
fn- a function that initializes a builder to create theDeleteRequest- Throws:
java.io.IOExceptionOpenSearchException
-
deletePit
public DeletePitResponse deletePit(DeletePitRequest request) throws java.io.IOException, OpenSearchException
Delete Point In Time- Throws:
java.io.IOExceptionOpenSearchException
-
deletePit
public final DeletePitResponse deletePit(java.util.function.Function<DeletePitRequest.Builder,ObjectBuilder<DeletePitRequest>> fn) throws java.io.IOException, OpenSearchException
Delete Point In Time- Parameters:
fn- a function that initializes a builder to create theDeletePitRequest- Throws:
java.io.IOExceptionOpenSearchException
-
deleteByQuery
public DeleteByQueryResponse deleteByQuery(DeleteByQueryRequest request) throws java.io.IOException, OpenSearchException
Deletes documents matching the provided query.- Throws:
java.io.IOExceptionOpenSearchException
-
deleteByQuery
public final DeleteByQueryResponse deleteByQuery(java.util.function.Function<DeleteByQueryRequest.Builder,ObjectBuilder<DeleteByQueryRequest>> fn) throws java.io.IOException, OpenSearchException
Deletes documents matching the provided query.- Parameters:
fn- a function that initializes a builder to create theDeleteByQueryRequest- Throws:
java.io.IOExceptionOpenSearchException
-
deleteByQueryRethrottle
public DeleteByQueryRethrottleResponse deleteByQueryRethrottle(DeleteByQueryRethrottleRequest request) throws java.io.IOException, OpenSearchException
Changes the number of requests per second for a particular Delete By Query operation.- Throws:
java.io.IOExceptionOpenSearchException
-
deleteByQueryRethrottle
public final DeleteByQueryRethrottleResponse deleteByQueryRethrottle(java.util.function.Function<DeleteByQueryRethrottleRequest.Builder,ObjectBuilder<DeleteByQueryRethrottleRequest>> fn) throws java.io.IOException, OpenSearchException
Changes the number of requests per second for a particular Delete By Query operation.- Parameters:
fn- a function that initializes a builder to create theDeleteByQueryRethrottleRequest- Throws:
java.io.IOExceptionOpenSearchException
-
deleteScript
public DeleteScriptResponse deleteScript(DeleteScriptRequest request) throws java.io.IOException, OpenSearchException
Deletes a script.- Throws:
java.io.IOExceptionOpenSearchException
-
deleteScript
public final DeleteScriptResponse deleteScript(java.util.function.Function<DeleteScriptRequest.Builder,ObjectBuilder<DeleteScriptRequest>> fn) throws java.io.IOException, OpenSearchException
Deletes a script.- Parameters:
fn- a function that initializes a builder to create theDeleteScriptRequest- Throws:
java.io.IOExceptionOpenSearchException
-
exists
public BooleanResponse exists(ExistsRequest request) throws java.io.IOException, OpenSearchException
Returns information about whether a document exists in an index.- Throws:
java.io.IOExceptionOpenSearchException
-
exists
public final BooleanResponse exists(java.util.function.Function<ExistsRequest.Builder,ObjectBuilder<ExistsRequest>> fn) throws java.io.IOException, OpenSearchException
Returns information about whether a document exists in an index.- Parameters:
fn- a function that initializes a builder to create theExistsRequest- Throws:
java.io.IOExceptionOpenSearchException
-
existsSource
public BooleanResponse existsSource(ExistsSourceRequest request) throws java.io.IOException, OpenSearchException
Returns information about whether a document source exists in an index.- Throws:
java.io.IOExceptionOpenSearchException
-
existsSource
public final BooleanResponse existsSource(java.util.function.Function<ExistsSourceRequest.Builder,ObjectBuilder<ExistsSourceRequest>> fn) throws java.io.IOException, OpenSearchException
Returns information about whether a document source exists in an index.- Parameters:
fn- a function that initializes a builder to create theExistsSourceRequest- Throws:
java.io.IOExceptionOpenSearchException
-
explain
public <TDocument> ExplainResponse<TDocument> explain(ExplainRequest request, java.lang.Class<TDocument> tDocumentClass) throws java.io.IOException, OpenSearchException
Returns information about why a specific matches (or doesn't match) a query.- Throws:
java.io.IOExceptionOpenSearchException
-
explain
public final <TDocument> ExplainResponse<TDocument> explain(java.util.function.Function<ExplainRequest.Builder,ObjectBuilder<ExplainRequest>> fn, java.lang.Class<TDocument> tDocumentClass) throws java.io.IOException, OpenSearchException
Returns information about why a specific matches (or doesn't match) a query.- Parameters:
fn- a function that initializes a builder to create theExplainRequest- Throws:
java.io.IOExceptionOpenSearchException
-
fieldCaps
public FieldCapsResponse fieldCaps(FieldCapsRequest request) throws java.io.IOException, OpenSearchException
Returns the information about the capabilities of fields among multiple indices.- Throws:
java.io.IOExceptionOpenSearchException
-
fieldCaps
public final FieldCapsResponse fieldCaps(java.util.function.Function<FieldCapsRequest.Builder,ObjectBuilder<FieldCapsRequest>> fn) throws java.io.IOException, OpenSearchException
Returns the information about the capabilities of fields among multiple indices.- Parameters:
fn- a function that initializes a builder to create theFieldCapsRequest- Throws:
java.io.IOExceptionOpenSearchException
-
fieldCaps
public FieldCapsResponse fieldCaps() throws java.io.IOException, OpenSearchException
Returns the information about the capabilities of fields among multiple indices.- Throws:
java.io.IOExceptionOpenSearchException
-
get
public <TDocument> GetResponse<TDocument> get(GetRequest request, java.lang.Class<TDocument> tDocumentClass) throws java.io.IOException, OpenSearchException
Returns a document.- Throws:
java.io.IOExceptionOpenSearchException
-
get
public final <TDocument> GetResponse<TDocument> get(java.util.function.Function<GetRequest.Builder,ObjectBuilder<GetRequest>> fn, java.lang.Class<TDocument> tDocumentClass) throws java.io.IOException, OpenSearchException
Returns a document.- Parameters:
fn- a function that initializes a builder to create theGetRequest- Throws:
java.io.IOExceptionOpenSearchException
-
getScript
public GetScriptResponse getScript(GetScriptRequest request) throws java.io.IOException, OpenSearchException
Returns a script.- Throws:
java.io.IOExceptionOpenSearchException
-
getScript
public final GetScriptResponse getScript(java.util.function.Function<GetScriptRequest.Builder,ObjectBuilder<GetScriptRequest>> fn) throws java.io.IOException, OpenSearchException
Returns a script.- Parameters:
fn- a function that initializes a builder to create theGetScriptRequest- Throws:
java.io.IOExceptionOpenSearchException
-
getScriptContext
public GetScriptContextResponse getScriptContext() throws java.io.IOException, OpenSearchException
Returns all script contexts.- Throws:
java.io.IOExceptionOpenSearchException
-
getScriptLanguages
public GetScriptLanguagesResponse getScriptLanguages() throws java.io.IOException, OpenSearchException
Returns available script types, languages and contexts- Throws:
java.io.IOExceptionOpenSearchException
-
getSource
public <TDocument> GetSourceResponse<TDocument> getSource(GetSourceRequest request, java.lang.Class<TDocument> tDocumentClass) throws java.io.IOException, OpenSearchException
Returns the source of a document.- Throws:
java.io.IOExceptionOpenSearchException
-
getSource
public final <TDocument> GetSourceResponse<TDocument> getSource(java.util.function.Function<GetSourceRequest.Builder,ObjectBuilder<GetSourceRequest>> fn, java.lang.Class<TDocument> tDocumentClass) throws java.io.IOException, OpenSearchException
Returns the source of a document.- Parameters:
fn- a function that initializes a builder to create theGetSourceRequest- Throws:
java.io.IOExceptionOpenSearchException
-
index
public <TDocument> IndexResponse index(IndexRequest<TDocument> request) throws java.io.IOException, OpenSearchException
Creates or updates a document in an index.- Throws:
java.io.IOExceptionOpenSearchException
-
index
public final <TDocument> IndexResponse index(java.util.function.Function<IndexRequest.Builder<TDocument>,ObjectBuilder<IndexRequest<TDocument>>> fn) throws java.io.IOException, OpenSearchException
Creates or updates a document in an index.- Parameters:
fn- a function that initializes a builder to create theIndexRequest- Throws:
java.io.IOExceptionOpenSearchException
-
info
public InfoResponse info() throws java.io.IOException, OpenSearchException
Returns basic information about the cluster.- Throws:
java.io.IOExceptionOpenSearchException
-
listAllPit
public ListAllPitResponse listAllPit() throws java.io.IOException, OpenSearchException
List all Point In Time- Throws:
java.io.IOExceptionOpenSearchException
-
mget
public <TDocument> MgetResponse<TDocument> mget(MgetRequest request, java.lang.Class<TDocument> tDocumentClass) throws java.io.IOException, OpenSearchException
Allows to get multiple documents in one request.- Throws:
java.io.IOExceptionOpenSearchException
-
mget
public final <TDocument> MgetResponse<TDocument> mget(java.util.function.Function<MgetRequest.Builder,ObjectBuilder<MgetRequest>> fn, java.lang.Class<TDocument> tDocumentClass) throws java.io.IOException, OpenSearchException
Allows to get multiple documents in one request.- Parameters:
fn- a function that initializes a builder to create theMgetRequest- Throws:
java.io.IOExceptionOpenSearchException
-
msearch
public <TDocument> MsearchResponse<TDocument> msearch(MsearchRequest request, java.lang.Class<TDocument> tDocumentClass) throws java.io.IOException, OpenSearchException
Allows to execute several search operations in one request.- Throws:
java.io.IOExceptionOpenSearchException
-
msearch
public final <TDocument> MsearchResponse<TDocument> msearch(java.util.function.Function<MsearchRequest.Builder,ObjectBuilder<MsearchRequest>> fn, java.lang.Class<TDocument> tDocumentClass) throws java.io.IOException, OpenSearchException
Allows to execute several search operations in one request.- Parameters:
fn- a function that initializes a builder to create theMsearchRequest- Throws:
java.io.IOExceptionOpenSearchException
-
msearchTemplate
public <TDocument> MsearchTemplateResponse<TDocument> msearchTemplate(MsearchTemplateRequest request, java.lang.Class<TDocument> tDocumentClass) throws java.io.IOException, OpenSearchException
Allows to execute several search template operations in one request.- Throws:
java.io.IOExceptionOpenSearchException
-
msearchTemplate
public final <TDocument> MsearchTemplateResponse<TDocument> msearchTemplate(java.util.function.Function<MsearchTemplateRequest.Builder,ObjectBuilder<MsearchTemplateRequest>> fn, java.lang.Class<TDocument> tDocumentClass) throws java.io.IOException, OpenSearchException
Allows to execute several search template operations in one request.- Parameters:
fn- a function that initializes a builder to create theMsearchTemplateRequest- Throws:
java.io.IOExceptionOpenSearchException
-
mtermvectors
public MtermvectorsResponse mtermvectors(MtermvectorsRequest request) throws java.io.IOException, OpenSearchException
Returns multiple termvectors in one request.- Throws:
java.io.IOExceptionOpenSearchException
-
mtermvectors
public final MtermvectorsResponse mtermvectors(java.util.function.Function<MtermvectorsRequest.Builder,ObjectBuilder<MtermvectorsRequest>> fn) throws java.io.IOException, OpenSearchException
Returns multiple termvectors in one request.- Parameters:
fn- a function that initializes a builder to create theMtermvectorsRequest- Throws:
java.io.IOExceptionOpenSearchException
-
mtermvectors
public MtermvectorsResponse mtermvectors() throws java.io.IOException, OpenSearchException
Returns multiple termvectors in one request.- Throws:
java.io.IOExceptionOpenSearchException
-
ping
public BooleanResponse ping() throws java.io.IOException, OpenSearchException
Returns whether the cluster is running.- Throws:
java.io.IOExceptionOpenSearchException
-
putScript
public PutScriptResponse putScript(PutScriptRequest request) throws java.io.IOException, OpenSearchException
Creates or updates a script.- Throws:
java.io.IOExceptionOpenSearchException
-
putScript
public final PutScriptResponse putScript(java.util.function.Function<PutScriptRequest.Builder,ObjectBuilder<PutScriptRequest>> fn) throws java.io.IOException, OpenSearchException
Creates or updates a script.- Parameters:
fn- a function that initializes a builder to create thePutScriptRequest- Throws:
java.io.IOExceptionOpenSearchException
-
rankEval
public RankEvalResponse rankEval(RankEvalRequest request) throws java.io.IOException, OpenSearchException
Allows to evaluate the quality of ranked search results over a set of typical search queries- Throws:
java.io.IOExceptionOpenSearchException
-
rankEval
public final RankEvalResponse rankEval(java.util.function.Function<RankEvalRequest.Builder,ObjectBuilder<RankEvalRequest>> fn) throws java.io.IOException, OpenSearchException
Allows to evaluate the quality of ranked search results over a set of typical search queries- Parameters:
fn- a function that initializes a builder to create theRankEvalRequest- Throws:
java.io.IOExceptionOpenSearchException
-
reindex
public ReindexResponse reindex(ReindexRequest request) throws java.io.IOException, OpenSearchException
Allows to copy documents from one index to another, optionally filtering the source documents by a query, changing the destination index settings, or fetching the documents from a remote cluster.- Throws:
java.io.IOExceptionOpenSearchException
-
reindex
public final ReindexResponse reindex(java.util.function.Function<ReindexRequest.Builder,ObjectBuilder<ReindexRequest>> fn) throws java.io.IOException, OpenSearchException
Allows to copy documents from one index to another, optionally filtering the source documents by a query, changing the destination index settings, or fetching the documents from a remote cluster.- Parameters:
fn- a function that initializes a builder to create theReindexRequest- Throws:
java.io.IOExceptionOpenSearchException
-
reindex
public ReindexResponse reindex() throws java.io.IOException, OpenSearchException
Allows to copy documents from one index to another, optionally filtering the source documents by a query, changing the destination index settings, or fetching the documents from a remote cluster.- Throws:
java.io.IOExceptionOpenSearchException
-
reindexRethrottle
public ReindexRethrottleResponse reindexRethrottle(ReindexRethrottleRequest request) throws java.io.IOException, OpenSearchException
Changes the number of requests per second for a particular Reindex operation.- Throws:
java.io.IOExceptionOpenSearchException
-
reindexRethrottle
public final ReindexRethrottleResponse reindexRethrottle(java.util.function.Function<ReindexRethrottleRequest.Builder,ObjectBuilder<ReindexRethrottleRequest>> fn) throws java.io.IOException, OpenSearchException
Changes the number of requests per second for a particular Reindex operation.- Parameters:
fn- a function that initializes a builder to create theReindexRethrottleRequest- Throws:
java.io.IOExceptionOpenSearchException
-
renderSearchTemplate
public RenderSearchTemplateResponse renderSearchTemplate(RenderSearchTemplateRequest request) throws java.io.IOException, OpenSearchException
Allows to use the Mustache language to pre-render a search definition.- Throws:
java.io.IOExceptionOpenSearchException
-
renderSearchTemplate
public final RenderSearchTemplateResponse renderSearchTemplate(java.util.function.Function<RenderSearchTemplateRequest.Builder,ObjectBuilder<RenderSearchTemplateRequest>> fn) throws java.io.IOException, OpenSearchException
Allows to use the Mustache language to pre-render a search definition.- Parameters:
fn- a function that initializes a builder to create theRenderSearchTemplateRequest- Throws:
java.io.IOExceptionOpenSearchException
-
renderSearchTemplate
public RenderSearchTemplateResponse renderSearchTemplate() throws java.io.IOException, OpenSearchException
Allows to use the Mustache language to pre-render a search definition.- Throws:
java.io.IOExceptionOpenSearchException
-
scriptsPainlessExecute
public <TResult> ScriptsPainlessExecuteResponse<TResult> scriptsPainlessExecute(ScriptsPainlessExecuteRequest request, java.lang.Class<TResult> tResultClass) throws java.io.IOException, OpenSearchException
Allows an arbitrary script to be executed and a result to be returned- Throws:
java.io.IOExceptionOpenSearchException
-
scriptsPainlessExecute
public final <TResult> ScriptsPainlessExecuteResponse<TResult> scriptsPainlessExecute(java.util.function.Function<ScriptsPainlessExecuteRequest.Builder,ObjectBuilder<ScriptsPainlessExecuteRequest>> fn, java.lang.Class<TResult> tResultClass) throws java.io.IOException, OpenSearchException
Allows an arbitrary script to be executed and a result to be returned- Parameters:
fn- a function that initializes a builder to create theScriptsPainlessExecuteRequest- Throws:
java.io.IOExceptionOpenSearchException
-
scroll
public <TDocument> ScrollResponse<TDocument> scroll(ScrollRequest request, java.lang.Class<TDocument> tDocumentClass) throws java.io.IOException, OpenSearchException
Allows to retrieve a large numbers of results from a single search request.- Throws:
java.io.IOExceptionOpenSearchException
-
scroll
public final <TDocument> ScrollResponse<TDocument> scroll(java.util.function.Function<ScrollRequest.Builder,ObjectBuilder<ScrollRequest>> fn, java.lang.Class<TDocument> tDocumentClass) throws java.io.IOException, OpenSearchException
Allows to retrieve a large numbers of results from a single search request.- Parameters:
fn- a function that initializes a builder to create theScrollRequest- Throws:
java.io.IOExceptionOpenSearchException
-
search
public <TDocument> SearchResponse<TDocument> search(SearchRequest request, java.lang.Class<TDocument> tDocumentClass) throws java.io.IOException, OpenSearchException
Returns results matching a query.- Throws:
java.io.IOExceptionOpenSearchException
-
search
public final <TDocument> SearchResponse<TDocument> search(java.util.function.Function<SearchRequest.Builder,ObjectBuilder<SearchRequest>> fn, java.lang.Class<TDocument> tDocumentClass) throws java.io.IOException, OpenSearchException
Returns results matching a query.- Parameters:
fn- a function that initializes a builder to create theSearchRequest- Throws:
java.io.IOExceptionOpenSearchException
-
searchShards
public SearchShardsResponse searchShards(SearchShardsRequest request) throws java.io.IOException, OpenSearchException
Returns information about the indices and shards that a search request would be executed against.- Throws:
java.io.IOExceptionOpenSearchException
-
searchShards
public final SearchShardsResponse searchShards(java.util.function.Function<SearchShardsRequest.Builder,ObjectBuilder<SearchShardsRequest>> fn) throws java.io.IOException, OpenSearchException
Returns information about the indices and shards that a search request would be executed against.- Parameters:
fn- a function that initializes a builder to create theSearchShardsRequest- Throws:
java.io.IOExceptionOpenSearchException
-
searchShards
public SearchShardsResponse searchShards() throws java.io.IOException, OpenSearchException
Returns information about the indices and shards that a search request would be executed against.- Throws:
java.io.IOExceptionOpenSearchException
-
searchTemplate
public <TDocument> SearchTemplateResponse<TDocument> searchTemplate(SearchTemplateRequest request, java.lang.Class<TDocument> tDocumentClass) throws java.io.IOException, OpenSearchException
Allows to use the Mustache language to pre-render a search definition.- Throws:
java.io.IOExceptionOpenSearchException
-
searchTemplate
public final <TDocument> SearchTemplateResponse<TDocument> searchTemplate(java.util.function.Function<SearchTemplateRequest.Builder,ObjectBuilder<SearchTemplateRequest>> fn, java.lang.Class<TDocument> tDocumentClass) throws java.io.IOException, OpenSearchException
Allows to use the Mustache language to pre-render a search definition.- Parameters:
fn- a function that initializes a builder to create theSearchTemplateRequest- Throws:
java.io.IOExceptionOpenSearchException
-
termsEnum
public TermsEnumResponse termsEnum(TermsEnumRequest request) throws java.io.IOException, OpenSearchException
The terms enum API can be used to discover terms in the index that begin with the provided string. It is designed for low-latency look-ups used in auto-complete scenarios.- Throws:
java.io.IOExceptionOpenSearchException
-
termsEnum
public final TermsEnumResponse termsEnum(java.util.function.Function<TermsEnumRequest.Builder,ObjectBuilder<TermsEnumRequest>> fn) throws java.io.IOException, OpenSearchException
The terms enum API can be used to discover terms in the index that begin with the provided string. It is designed for low-latency look-ups used in auto-complete scenarios.- Parameters:
fn- a function that initializes a builder to create theTermsEnumRequest- Throws:
java.io.IOExceptionOpenSearchException
-
termvectors
public <TDocument> TermvectorsResponse termvectors(TermvectorsRequest<TDocument> request) throws java.io.IOException, OpenSearchException
Returns information and statistics about terms in the fields of a particular document.- Throws:
java.io.IOExceptionOpenSearchException
-
termvectors
public final <TDocument> TermvectorsResponse termvectors(java.util.function.Function<TermvectorsRequest.Builder<TDocument>,ObjectBuilder<TermvectorsRequest<TDocument>>> fn) throws java.io.IOException, OpenSearchException
Returns information and statistics about terms in the fields of a particular document.- Parameters:
fn- a function that initializes a builder to create theTermvectorsRequest- Throws:
java.io.IOExceptionOpenSearchException
-
update
public <TDocument,TPartialDocument> UpdateResponse<TDocument> update(UpdateRequest<TDocument,TPartialDocument> request, java.lang.Class<TDocument> tDocumentClass) throws java.io.IOException, OpenSearchException
Updates a document with a script or partial document.- Throws:
java.io.IOExceptionOpenSearchException
-
update
public final <TDocument,TPartialDocument> UpdateResponse<TDocument> update(java.util.function.Function<UpdateRequest.Builder<TDocument,TPartialDocument>,ObjectBuilder<UpdateRequest<TDocument,TPartialDocument>>> fn, java.lang.Class<TDocument> tDocumentClass) throws java.io.IOException, OpenSearchException
Updates a document with a script or partial document.- Parameters:
fn- a function that initializes a builder to create theUpdateRequest- Throws:
java.io.IOExceptionOpenSearchException
-
updateByQuery
public UpdateByQueryResponse updateByQuery(UpdateByQueryRequest request) throws java.io.IOException, OpenSearchException
Performs an update on every document in the index without changing the source, for example to pick up a mapping change.- Throws:
java.io.IOExceptionOpenSearchException
-
updateByQuery
public final UpdateByQueryResponse updateByQuery(java.util.function.Function<UpdateByQueryRequest.Builder,ObjectBuilder<UpdateByQueryRequest>> fn) throws java.io.IOException, OpenSearchException
Performs an update on every document in the index without changing the source, for example to pick up a mapping change.- Parameters:
fn- a function that initializes a builder to create theUpdateByQueryRequest- Throws:
java.io.IOExceptionOpenSearchException
-
updateByQueryRethrottle
public UpdateByQueryRethrottleResponse updateByQueryRethrottle(UpdateByQueryRethrottleRequest request) throws java.io.IOException, OpenSearchException
Changes the number of requests per second for a particular Update By Query operation.- Throws:
java.io.IOExceptionOpenSearchException
-
updateByQueryRethrottle
public final UpdateByQueryRethrottleResponse updateByQueryRethrottle(java.util.function.Function<UpdateByQueryRethrottleRequest.Builder,ObjectBuilder<UpdateByQueryRethrottleRequest>> fn) throws java.io.IOException, OpenSearchException
Changes the number of requests per second for a particular Update By Query operation.- Parameters:
fn- a function that initializes a builder to create theUpdateByQueryRethrottleRequest- Throws:
java.io.IOExceptionOpenSearchException
-
-