Class OpenSearchKnnClient
java.lang.Object
org.opensearch.client.ApiClient<OpenSearchTransport,OpenSearchKnnClient>
org.opensearch.client.opensearch.knn.OpenSearchKnnClient
@Generated("org.opensearch.client.codegen.CodeGenerator")
public class OpenSearchKnnClient
extends ApiClient<OpenSearchTransport,OpenSearchKnnClient>
Client for the knn namespace.
-
Field Summary
Fields inherited from class org.opensearch.client.ApiClient
transport, transportOptions -
Constructor Summary
ConstructorsConstructorDescriptionOpenSearchKnnClient(OpenSearchTransport transport) OpenSearchKnnClient(OpenSearchTransport transport, TransportOptions transportOptions) -
Method Summary
Modifier and TypeMethodDescriptionfinal DeleteModelResponseUsed to delete a particular model in the cluster.deleteModel(DeleteModelRequest request) Used to delete a particular model in the cluster.final GetModelResponseUsed to retrieve information about models present in the cluster.getModel(GetModelRequest request) Used to retrieve information about models present in the cluster.final SearchModelsResponseUse an OpenSearch query to search for models in the index.final SearchModelsResponseUse an OpenSearch query to search for models in the index.searchModels(SearchModelsRequest request) Use an OpenSearch query to search for models in the index.final KnnStatsResponsestats()Provides information about the current status of the k-NN plugin.final KnnStatsResponseProvides information about the current status of the k-NN plugin.stats(KnnStatsRequest request) Provides information about the current status of the k-NN plugin.final TrainModelResponseCreate and train a model that can be used for initializing k-NN native library indexes during indexing.trainModel(TrainModelRequest request) Create and train a model that can be used for initializing k-NN native library indexes during indexing.final WarmupResponsePreloads native library files into memory, reducing initial search latency for specified indexes.warmup(WarmupRequest request) Preloads native library files into memory, reducing initial search latency for specified indexes.withTransportOptions(TransportOptions transportOptions) Creates a new client with some request optionsMethods inherited from class org.opensearch.client.ApiClient
_transport, _transportOptions, getDeserializer
-
Constructor Details
-
OpenSearchKnnClient
-
OpenSearchKnnClient
public OpenSearchKnnClient(OpenSearchTransport transport, @Nullable TransportOptions transportOptions)
-
-
Method Details
-
withTransportOptions
Description copied from class:ApiClientCreates a new client with some request options- Specified by:
withTransportOptionsin classApiClient<OpenSearchTransport,OpenSearchKnnClient>
-
deleteModel
public DeleteModelResponse deleteModel(DeleteModelRequest request) throws IOException, OpenSearchException Used to delete a particular model in the cluster.- Throws:
IOExceptionOpenSearchException
-
deleteModel
public final DeleteModelResponse deleteModel(Function<DeleteModelRequest.Builder, ObjectBuilder<DeleteModelRequest>> fn) throws IOException, OpenSearchExceptionUsed to delete a particular model in the cluster.- Parameters:
fn- a function that initializes a builder to create theDeleteModelRequest- Throws:
IOExceptionOpenSearchException
-
getModel
Used to retrieve information about models present in the cluster.- Throws:
IOExceptionOpenSearchException
-
getModel
public final GetModelResponse getModel(Function<GetModelRequest.Builder, ObjectBuilder<GetModelRequest>> fn) throws IOException, OpenSearchExceptionUsed to retrieve information about models present in the cluster.- Parameters:
fn- a function that initializes a builder to create theGetModelRequest- Throws:
IOExceptionOpenSearchException
-
searchModels
public SearchModelsResponse searchModels(SearchModelsRequest request) throws IOException, OpenSearchException Use an OpenSearch query to search for models in the index.- Throws:
IOExceptionOpenSearchException
-
searchModels
public final SearchModelsResponse searchModels(Function<SearchModelsRequest.Builder, ObjectBuilder<SearchModelsRequest>> fn) throws IOException, OpenSearchExceptionUse an OpenSearch query to search for models in the index.- Parameters:
fn- a function that initializes a builder to create theSearchModelsRequest- Throws:
IOExceptionOpenSearchException
-
searchModels
Use an OpenSearch query to search for models in the index.- Throws:
IOExceptionOpenSearchException
-
stats
Provides information about the current status of the k-NN plugin.- Throws:
IOExceptionOpenSearchException
-
stats
public final KnnStatsResponse stats(Function<KnnStatsRequest.Builder, ObjectBuilder<KnnStatsRequest>> fn) throws IOException, OpenSearchExceptionProvides information about the current status of the k-NN plugin.- Parameters:
fn- a function that initializes a builder to create theKnnStatsRequest- Throws:
IOExceptionOpenSearchException
-
stats
Provides information about the current status of the k-NN plugin.- Throws:
IOExceptionOpenSearchException
-
trainModel
public TrainModelResponse trainModel(TrainModelRequest request) throws IOException, OpenSearchException Create and train a model that can be used for initializing k-NN native library indexes during indexing.- Throws:
IOExceptionOpenSearchException
-
trainModel
public final TrainModelResponse trainModel(Function<TrainModelRequest.Builder, ObjectBuilder<TrainModelRequest>> fn) throws IOException, OpenSearchExceptionCreate and train a model that can be used for initializing k-NN native library indexes during indexing.- Parameters:
fn- a function that initializes a builder to create theTrainModelRequest- Throws:
IOExceptionOpenSearchException
-
warmup
Preloads native library files into memory, reducing initial search latency for specified indexes.- Throws:
IOExceptionOpenSearchException
-
warmup
public final WarmupResponse warmup(Function<WarmupRequest.Builder, ObjectBuilder<WarmupRequest>> fn) throws IOException, OpenSearchExceptionPreloads native library files into memory, reducing initial search latency for specified indexes.- Parameters:
fn- a function that initializes a builder to create theWarmupRequest- Throws:
IOExceptionOpenSearchException
-