Class OpenSearchClient

java.lang.Object
org.opensearch.client.base.ApiClient<OpenSearchClient>
org.opensearch.client.opensearch.OpenSearchClient

public class OpenSearchClient
extends ApiClient<OpenSearchClient>
Client for the namespace.
  • Constructor Details

  • Method Details

    • cat

      public CatClient cat()
    • cluster

      public ClusterClient cluster()
    • danglingIndices

      public DanglingIndicesClient danglingIndices()
    • features

      public FeaturesClient features()
    • indices

      public IndicesClient indices()
    • ingest

      public IngestClient ingest()
    • nodes

      public NodesClient nodes()
    • shutdown

      public ShutdownClient shutdown()
    • snapshot

      public SnapshotClient snapshot()
    • tasks

      public TasksClient tasks()
    • bulk

      public <TSource> BulkResponse bulk​(BulkRequest<TSource> request) throws java.io.IOException
      Allows to perform multiple index/update/delete operations in a single request.
      Throws:
      java.io.IOException
    • bulk

      public final <TSource> BulkResponse bulk​(java.util.function.Function<BulkRequest.Builder<TSource>,​ObjectBuilder<BulkRequest<TSource>>> fn) throws java.io.IOException
      Allows to perform multiple index/update/delete operations in a single request.
      Parameters:
      fn - a function that initializes a freshly created builder. This function can either return its builder argument after having set its properties or return another builder.
      Throws:
      java.io.IOException
    • clearScroll

      public ClearScrollResponse clearScroll​(ClearScrollRequest request) throws java.io.IOException
      Explicitly clears the search context for a scroll.
      Throws:
      java.io.IOException
    • clearScroll

      public final ClearScrollResponse clearScroll​(java.util.function.Function<ClearScrollRequest.Builder,​ObjectBuilder<ClearScrollRequest>> fn) throws java.io.IOException
      Explicitly clears the search context for a scroll.
      Parameters:
      fn - a function that initializes a freshly created builder. This function can either return its builder argument after having set its properties or return another builder.
      Throws:
      java.io.IOException
    • closePointInTime

      public ClosePointInTimeResponse closePointInTime​(ClosePointInTimeRequest request) throws java.io.IOException
      Close a point in time
      Throws:
      java.io.IOException
    • closePointInTime

      public final ClosePointInTimeResponse closePointInTime​(java.util.function.Function<ClosePointInTimeRequest.Builder,​ObjectBuilder<ClosePointInTimeRequest>> fn) throws java.io.IOException
      Close a point in time
      Parameters:
      fn - a function that initializes a freshly created builder. This function can either return its builder argument after having set its properties or return another builder.
      Throws:
      java.io.IOException
    • count

      public CountResponse count​(CountRequest request) throws java.io.IOException
      Returns number of documents matching a query.
      Throws:
      java.io.IOException
    • count

      public final CountResponse count​(java.util.function.Function<CountRequest.Builder,​ObjectBuilder<CountRequest>> fn) throws java.io.IOException
      Returns number of documents matching a query.
      Parameters:
      fn - a function that initializes a freshly created builder. This function can either return its builder argument after having set its properties or return another builder.
      Throws:
      java.io.IOException
    • create

      public <TDocument> CreateResponse create​(CreateRequest<TDocument> request) throws java.io.IOException
      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.IOException
    • create

      public final <TDocument> CreateResponse create​(java.util.function.Function<CreateRequest.Builder<TDocument>,​ObjectBuilder<CreateRequest<TDocument>>> fn) throws java.io.IOException
      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 freshly created builder. This function can either return its builder argument after having set its properties or return another builder.
      Throws:
      java.io.IOException
    • delete

      public DeleteResponse delete​(DeleteRequest request) throws java.io.IOException
      Removes a document from the index.
      Throws:
      java.io.IOException
    • delete

      public final DeleteResponse delete​(java.util.function.Function<DeleteRequest.Builder,​ObjectBuilder<DeleteRequest>> fn) throws java.io.IOException
      Removes a document from the index.
      Parameters:
      fn - a function that initializes a freshly created builder. This function can either return its builder argument after having set its properties or return another builder.
      Throws:
      java.io.IOException
    • deleteByQuery

      public DeleteByQueryResponse deleteByQuery​(DeleteByQueryRequest request) throws java.io.IOException
      Deletes documents matching the provided query.
      Throws:
      java.io.IOException
    • deleteByQuery

      public final DeleteByQueryResponse deleteByQuery​(java.util.function.Function<DeleteByQueryRequest.Builder,​ObjectBuilder<DeleteByQueryRequest>> fn) throws java.io.IOException
      Deletes documents matching the provided query.
      Parameters:
      fn - a function that initializes a freshly created builder. This function can either return its builder argument after having set its properties or return another builder.
      Throws:
      java.io.IOException
    • deleteByQueryRethrottle

      public DeleteByQueryRethrottleResponse deleteByQueryRethrottle​(DeleteByQueryRethrottleRequest request) throws java.io.IOException
      Changes the number of requests per second for a particular Delete By Query operation.
      Throws:
      java.io.IOException
    • deleteByQueryRethrottle

      public final DeleteByQueryRethrottleResponse deleteByQueryRethrottle​(java.util.function.Function<DeleteByQueryRethrottleRequest.Builder,​ObjectBuilder<DeleteByQueryRethrottleRequest>> fn) throws java.io.IOException
      Changes the number of requests per second for a particular Delete By Query operation.
      Parameters:
      fn - a function that initializes a freshly created builder. This function can either return its builder argument after having set its properties or return another builder.
      Throws:
      java.io.IOException
    • deleteScript

      public DeleteScriptResponse deleteScript​(DeleteScriptRequest request) throws java.io.IOException
      Deletes a script.
      Throws:
      java.io.IOException
    • deleteScript

      public final DeleteScriptResponse deleteScript​(java.util.function.Function<DeleteScriptRequest.Builder,​ObjectBuilder<DeleteScriptRequest>> fn) throws java.io.IOException
      Deletes a script.
      Parameters:
      fn - a function that initializes a freshly created builder. This function can either return its builder argument after having set its properties or return another builder.
      Throws:
      java.io.IOException
    • exists

      public BooleanResponse exists​(ExistsRequest request) throws java.io.IOException
      Returns information about whether a document exists in an index.
      Throws:
      java.io.IOException
    • exists

      public final BooleanResponse exists​(java.util.function.Function<ExistsRequest.Builder,​ObjectBuilder<ExistsRequest>> fn) throws java.io.IOException
      Returns information about whether a document exists in an index.
      Parameters:
      fn - a function that initializes a freshly created builder. This function can either return its builder argument after having set its properties or return another builder.
      Throws:
      java.io.IOException
    • existsSource

      public BooleanResponse existsSource​(ExistsSourceRequest request) throws java.io.IOException
      Returns information about whether a document source exists in an index.
      Throws:
      java.io.IOException
    • existsSource

      public final BooleanResponse existsSource​(java.util.function.Function<ExistsSourceRequest.Builder,​ObjectBuilder<ExistsSourceRequest>> fn) throws java.io.IOException
      Returns information about whether a document source exists in an index.
      Parameters:
      fn - a function that initializes a freshly created builder. This function can either return its builder argument after having set its properties or return another builder.
      Throws:
      java.io.IOException
    • explain

      public <TDocument> ExplainResponse<TDocument> explain​(ExplainRequest request, java.lang.Class<TDocument> tDocumentClass) throws java.io.IOException
      Returns information about why a specific matches (or doesn't match) a query.
      Throws:
      java.io.IOException
    • 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
      Returns information about why a specific matches (or doesn't match) a query.
      Parameters:
      fn - a function that initializes a freshly created builder. This function can either return its builder argument after having set its properties or return another builder.
      Throws:
      java.io.IOException
    • fieldCaps

      public FieldCapsResponse fieldCaps​(FieldCapsRequest request) throws java.io.IOException
      Returns the information about the capabilities of fields among multiple indices.
      Throws:
      java.io.IOException
    • fieldCaps

      public final FieldCapsResponse fieldCaps​(java.util.function.Function<FieldCapsRequest.Builder,​ObjectBuilder<FieldCapsRequest>> fn) throws java.io.IOException
      Returns the information about the capabilities of fields among multiple indices.
      Parameters:
      fn - a function that initializes a freshly created builder. This function can either return its builder argument after having set its properties or return another builder.
      Throws:
      java.io.IOException
    • get

      public <TDocument> GetResponse<TDocument> get​(GetRequest request, java.lang.Class<TDocument> tDocumentClass) throws java.io.IOException
      Returns a document.
      Throws:
      java.io.IOException
    • 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
      Returns a document.
      Parameters:
      fn - a function that initializes a freshly created builder. This function can either return its builder argument after having set its properties or return another builder.
      Throws:
      java.io.IOException
    • getScript

      public GetScriptResponse getScript​(GetScriptRequest request) throws java.io.IOException
      Returns a script.
      Throws:
      java.io.IOException
    • getScript

      public final GetScriptResponse getScript​(java.util.function.Function<GetScriptRequest.Builder,​ObjectBuilder<GetScriptRequest>> fn) throws java.io.IOException
      Returns a script.
      Parameters:
      fn - a function that initializes a freshly created builder. This function can either return its builder argument after having set its properties or return another builder.
      Throws:
      java.io.IOException
    • getScriptContext

      public GetScriptContextResponse getScriptContext() throws java.io.IOException
      Returns all script contexts.
      Throws:
      java.io.IOException
    • getScriptLanguages

      public GetScriptLanguagesResponse getScriptLanguages() throws java.io.IOException
      Returns available script types, languages and contexts
      Throws:
      java.io.IOException
    • getSource

      public <TDocument> GetSourceResponse<TDocument> getSource​(GetSourceRequest request, java.lang.Class<TDocument> tDocumentClass) throws java.io.IOException
      Returns the source of a document.
      Throws:
      java.io.IOException
    • 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
      Returns the source of a document.
      Parameters:
      fn - a function that initializes a freshly created builder. This function can either return its builder argument after having set its properties or return another builder.
      Throws:
      java.io.IOException
    • index

      public <TDocument> IndexResponse index​(IndexRequest<TDocument> request) throws java.io.IOException
      Creates or updates a document in an index.
      Throws:
      java.io.IOException
    • index

      public final <TDocument> IndexResponse index​(java.util.function.Function<IndexRequest.Builder<TDocument>,​ObjectBuilder<IndexRequest<TDocument>>> fn) throws java.io.IOException
      Creates or updates a document in an index.
      Parameters:
      fn - a function that initializes a freshly created builder. This function can either return its builder argument after having set its properties or return another builder.
      Throws:
      java.io.IOException
    • info

      public InfoResponse info() throws java.io.IOException
      Returns basic information about the cluster.
      Throws:
      java.io.IOException
    • mget

      public <TDocument> MgetResponse<TDocument> mget​(MgetRequest request, java.lang.Class<TDocument> tDocumentClass) throws java.io.IOException
      Allows to get multiple documents in one request.
      Throws:
      java.io.IOException
    • 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
      Allows to get multiple documents in one request.
      Parameters:
      fn - a function that initializes a freshly created builder. This function can either return its builder argument after having set its properties or return another builder.
      Throws:
      java.io.IOException
    • msearch

      public <TDocument> MsearchResponse<TDocument> msearch​(MsearchRequest request, java.lang.Class<TDocument> tDocumentClass) throws java.io.IOException
      Allows to execute several search operations in one request.
      Throws:
      java.io.IOException
    • 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
      Allows to execute several search operations in one request.
      Parameters:
      fn - a function that initializes a freshly created builder. This function can either return its builder argument after having set its properties or return another builder.
      Throws:
      java.io.IOException
    • msearchTemplate

      public <TDocument> MsearchTemplateResponse<TDocument> msearchTemplate​(MsearchTemplateRequest request, java.lang.Class<TDocument> tDocumentClass) throws java.io.IOException
      Allows to execute several search template operations in one request.
      Throws:
      java.io.IOException
    • 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
      Allows to execute several search template operations in one request.
      Parameters:
      fn - a function that initializes a freshly created builder. This function can either return its builder argument after having set its properties or return another builder.
      Throws:
      java.io.IOException
    • mtermvectors

      public MtermvectorsResponse mtermvectors​(MtermvectorsRequest request) throws java.io.IOException
      Returns multiple termvectors in one request.
      Throws:
      java.io.IOException
    • mtermvectors

      public final MtermvectorsResponse mtermvectors​(java.util.function.Function<MtermvectorsRequest.Builder,​ObjectBuilder<MtermvectorsRequest>> fn) throws java.io.IOException
      Returns multiple termvectors in one request.
      Parameters:
      fn - a function that initializes a freshly created builder. This function can either return its builder argument after having set its properties or return another builder.
      Throws:
      java.io.IOException
    • openPointInTime

      public OpenPointInTimeResponse openPointInTime​(OpenPointInTimeRequest request) throws java.io.IOException
      Open a point in time that can be used in subsequent searches
      Throws:
      java.io.IOException
    • openPointInTime

      public final OpenPointInTimeResponse openPointInTime​(java.util.function.Function<OpenPointInTimeRequest.Builder,​ObjectBuilder<OpenPointInTimeRequest>> fn) throws java.io.IOException
      Open a point in time that can be used in subsequent searches
      Parameters:
      fn - a function that initializes a freshly created builder. This function can either return its builder argument after having set its properties or return another builder.
      Throws:
      java.io.IOException
    • ping

      public BooleanResponse ping() throws java.io.IOException
      Returns whether the cluster is running.
      Throws:
      java.io.IOException
    • putScript

      public PutScriptResponse putScript​(PutScriptRequest request) throws java.io.IOException
      Creates or updates a script.
      Throws:
      java.io.IOException
    • putScript

      public final PutScriptResponse putScript​(java.util.function.Function<PutScriptRequest.Builder,​ObjectBuilder<PutScriptRequest>> fn) throws java.io.IOException
      Creates or updates a script.
      Parameters:
      fn - a function that initializes a freshly created builder. This function can either return its builder argument after having set its properties or return another builder.
      Throws:
      java.io.IOException
    • rankEval

      public RankEvalResponse rankEval​(RankEvalRequest request) throws java.io.IOException
      Allows to evaluate the quality of ranked search results over a set of typical search queries
      Throws:
      java.io.IOException
    • rankEval

      public final RankEvalResponse rankEval​(java.util.function.Function<RankEvalRequest.Builder,​ObjectBuilder<RankEvalRequest>> fn) throws java.io.IOException
      Allows to evaluate the quality of ranked search results over a set of typical search queries
      Parameters:
      fn - a function that initializes a freshly created builder. This function can either return its builder argument after having set its properties or return another builder.
      Throws:
      java.io.IOException
    • reindex

      public ReindexResponse reindex​(ReindexRequest request) throws java.io.IOException
      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.IOException
    • reindex

      public final ReindexResponse reindex​(java.util.function.Function<ReindexRequest.Builder,​ObjectBuilder<ReindexRequest>> fn) throws java.io.IOException
      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 freshly created builder. This function can either return its builder argument after having set its properties or return another builder.
      Throws:
      java.io.IOException
    • reindexRethrottle

      public ReindexRethrottleResponse reindexRethrottle​(ReindexRethrottleRequest request) throws java.io.IOException
      Changes the number of requests per second for a particular Reindex operation.
      Throws:
      java.io.IOException
    • reindexRethrottle

      public final ReindexRethrottleResponse reindexRethrottle​(java.util.function.Function<ReindexRethrottleRequest.Builder,​ObjectBuilder<ReindexRethrottleRequest>> fn) throws java.io.IOException
      Changes the number of requests per second for a particular Reindex operation.
      Parameters:
      fn - a function that initializes a freshly created builder. This function can either return its builder argument after having set its properties or return another builder.
      Throws:
      java.io.IOException
    • scriptsPainlessExecute

      public <TResult> ScriptsPainlessExecuteResponse<TResult> scriptsPainlessExecute​(ScriptsPainlessExecuteRequest request, java.lang.Class<TResult> tResultClass) throws java.io.IOException
      Allows an arbitrary script to be executed and a result to be returned
      Throws:
      java.io.IOException
    • 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
      Allows an arbitrary script to be executed and a result to be returned
      Parameters:
      fn - a function that initializes a freshly created builder. This function can either return its builder argument after having set its properties or return another builder.
      Throws:
      java.io.IOException
    • search

      public <TDocument> SearchResponse<TDocument> search​(SearchRequest request, java.lang.Class<TDocument> tDocumentClass) throws java.io.IOException
      Returns results matching a query.
      Throws:
      java.io.IOException
    • 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
      Returns results matching a query.
      Parameters:
      fn - a function that initializes a freshly created builder. This function can either return its builder argument after having set its properties or return another builder.
      Throws:
      java.io.IOException
    • searchShards

      public SearchShardsResponse searchShards​(SearchShardsRequest request) throws java.io.IOException
      Returns information about the indices and shards that a search request would be executed against.
      Throws:
      java.io.IOException
    • searchShards

      public final SearchShardsResponse searchShards​(java.util.function.Function<SearchShardsRequest.Builder,​ObjectBuilder<SearchShardsRequest>> fn) throws java.io.IOException
      Returns information about the indices and shards that a search request would be executed against.
      Parameters:
      fn - a function that initializes a freshly created builder. This function can either return its builder argument after having set its properties or return another builder.
      Throws:
      java.io.IOException
    • searchTemplate

      public <TDocument> SearchTemplateResponse<TDocument> searchTemplate​(SearchTemplateRequest request, java.lang.Class<TDocument> tDocumentClass) throws java.io.IOException
      Allows to use the Mustache language to pre-render a search definition.
      Throws:
      java.io.IOException
    • 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
      Allows to use the Mustache language to pre-render a search definition.
      Parameters:
      fn - a function that initializes a freshly created builder. This function can either return its builder argument after having set its properties or return another builder.
      Throws:
      java.io.IOException
    • termsEnum

      public TermsEnumResponse termsEnum​(TermsEnumRequest request) throws java.io.IOException
      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.IOException
    • termsEnum

      public final TermsEnumResponse termsEnum​(java.util.function.Function<TermsEnumRequest.Builder,​ObjectBuilder<TermsEnumRequest>> fn) throws java.io.IOException
      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 freshly created builder. This function can either return its builder argument after having set its properties or return another builder.
      Throws:
      java.io.IOException
    • termvectors

      public <TDocument> TermvectorsResponse termvectors​(TermvectorsRequest<TDocument> request) throws java.io.IOException
      Returns information and statistics about terms in the fields of a particular document.
      Throws:
      java.io.IOException
    • termvectors

      public final <TDocument> TermvectorsResponse termvectors​(java.util.function.Function<TermvectorsRequest.Builder<TDocument>,​ObjectBuilder<TermvectorsRequest<TDocument>>> fn) throws java.io.IOException
      Returns information and statistics about terms in the fields of a particular document.
      Parameters:
      fn - a function that initializes a freshly created builder. This function can either return its builder argument after having set its properties or return another builder.
      Throws:
      java.io.IOException
    • update

      public <TDocument,​ TPartialDocument> UpdateResponse<TDocument> update​(UpdateRequest<TDocument,​TPartialDocument> request, java.lang.Class<TDocument> tDocumentClass) throws java.io.IOException
      Updates a document with a script or partial document.
      Throws:
      java.io.IOException
    • 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
      Updates a document with a script or partial document.
      Parameters:
      fn - a function that initializes a freshly created builder. This function can either return its builder argument after having set its properties or return another builder.
      Throws:
      java.io.IOException
    • updateByQuery

      public UpdateByQueryResponse updateByQuery​(UpdateByQueryRequest request) throws java.io.IOException
      Performs an update on every document in the index without changing the source, for example to pick up a mapping change.
      Throws:
      java.io.IOException
    • updateByQuery

      public final UpdateByQueryResponse updateByQuery​(java.util.function.Function<UpdateByQueryRequest.Builder,​ObjectBuilder<UpdateByQueryRequest>> fn) throws java.io.IOException
      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 freshly created builder. This function can either return its builder argument after having set its properties or return another builder.
      Throws:
      java.io.IOException
    • updateByQueryRethrottle

      public UpdateByQueryRethrottleResponse updateByQueryRethrottle​(UpdateByQueryRethrottleRequest request) throws java.io.IOException
      Changes the number of requests per second for a particular Update By Query operation.
      Throws:
      java.io.IOException
    • updateByQueryRethrottle

      public final UpdateByQueryRethrottleResponse updateByQueryRethrottle​(java.util.function.Function<UpdateByQueryRethrottleRequest.Builder,​ObjectBuilder<UpdateByQueryRethrottleRequest>> fn) throws java.io.IOException
      Changes the number of requests per second for a particular Update By Query operation.
      Parameters:
      fn - a function that initializes a freshly created builder. This function can either return its builder argument after having set its properties or return another builder.
      Throws:
      java.io.IOException
    • withRequestOptions

      public OpenSearchClient withRequestOptions​(@Nullable org.opensearch.client.RequestOptions options)
      Specified by:
      withRequestOptions in class ApiClient<OpenSearchClient>
    • withRequestOptions

      public OpenSearchClient withRequestOptions​(java.util.function.Function<org.opensearch.client.RequestOptions.Builder,​org.opensearch.client.RequestOptions.Builder> fn)
      Creates a new OpenSearchClient(org.opensearch.client.base.Transport, org.opensearch.client.RequestOptions) with specific request options, inheriting existing options.
      Parameters:
      fn - a function taking an options builder initialized with the current request options, or initialized with default values.