| GitHub Repository | Product Reference |
Service Description: VectorSearchService provides methods for managing Collection resources, and Collection Index resources. The primary resources offered by this service are Collections which are a container for a set of related JSON data objects, and Collection Indexes which enable efficient ANN search across data objects within a Collection.
This class provides the ability to make remote calls to the backing service through method calls that map to API methods. Sample code to get started:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) {
CollectionName name = CollectionName.of("[PROJECT]", "[LOCATION]", "[COLLECTION]");
Collection response = vectorSearchServiceClient.getCollection(name);
}
Note: close() needs to be called on the VectorSearchServiceClient object to clean up resources such as threads. In the example above, try-with-resources is used, which automatically calls close().
| Method | Description | Method Variants |
|---|---|---|
ListCollections |
Lists Collections in a given project and location. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetCollection |
Gets details of a single Collection. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
CreateCollection |
Creates a new Collection in a given project and location. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
UpdateCollection |
Updates the parameters of a single Collection. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
DeleteCollection |
Deletes a single Collection. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ListIndexes |
Lists Indexes in a given project and location. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetIndex |
Gets details of a single Index. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
CreateIndex |
Creates a new Index in a given project and location. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
DeleteIndex |
Deletes a single Index. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ImportDataObjects |
Initiates a Long-Running Operation to import DataObjects into a Collection. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ListLocations |
Lists information about the supported locations for this service. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetLocation |
Gets information about a location. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
See the individual methods for example code.
Many parameters require resource names to be formatted in a particular way. To assist with these names, this class includes a format method for each type of name, and additionally a parse method to extract the individual identifiers contained within names that are returned.
This class can be customized by passing in a custom instance of VectorSearchServiceSettings to create(). For example:
To customize credentials:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
VectorSearchServiceSettings vectorSearchServiceSettings =
VectorSearchServiceSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
.build();
VectorSearchServiceClient vectorSearchServiceClient =
VectorSearchServiceClient.create(vectorSearchServiceSettings);
To customize the endpoint:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
VectorSearchServiceSettings vectorSearchServiceSettings =
VectorSearchServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
VectorSearchServiceClient vectorSearchServiceClient =
VectorSearchServiceClient.create(vectorSearchServiceSettings);
To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over the wire:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
VectorSearchServiceSettings vectorSearchServiceSettings =
VectorSearchServiceSettings.newHttpJsonBuilder().build();
VectorSearchServiceClient vectorSearchServiceClient =
VectorSearchServiceClient.create(vectorSearchServiceSettings);
Please refer to the GitHub repository's samples for more quickstart code snippets.
Static Methods
create()
public static final VectorSearchServiceClient create()Constructs an instance of VectorSearchServiceClient with default settings.
| Returns | |
|---|---|
| Type | Description |
VectorSearchServiceClient |
|
| Exceptions | |
|---|---|
| Type | Description |
IOException |
|
create(VectorSearchServiceSettings settings)
public static final VectorSearchServiceClient create(VectorSearchServiceSettings settings)Constructs an instance of VectorSearchServiceClient, using the given settings. The channels are created based on the settings passed in, or defaults for any settings that are not set.
| Parameter | |
|---|---|
| Name | Description |
settings |
VectorSearchServiceSettings |
| Returns | |
|---|---|
| Type | Description |
VectorSearchServiceClient |
|
| Exceptions | |
|---|---|
| Type | Description |
IOException |
|
create(VectorSearchServiceStub stub)
public static final VectorSearchServiceClient create(VectorSearchServiceStub stub)Constructs an instance of VectorSearchServiceClient, using the given stub for making calls. This is for advanced usage - prefer using create(VectorSearchServiceSettings).
| Parameter | |
|---|---|
| Name | Description |
stub |
VectorSearchServiceStub |
| Returns | |
|---|---|
| Type | Description |
VectorSearchServiceClient |
|
Constructors
VectorSearchServiceClient(VectorSearchServiceSettings settings)
protected VectorSearchServiceClient(VectorSearchServiceSettings settings)Constructs an instance of VectorSearchServiceClient, using the given settings. This is protected so that it is easy to make a subclass, but otherwise, the static factory methods should be preferred.
| Parameter | |
|---|---|
| Name | Description |
settings |
VectorSearchServiceSettings |
VectorSearchServiceClient(VectorSearchServiceStub stub)
protected VectorSearchServiceClient(VectorSearchServiceStub stub)| Parameter | |
|---|---|
| Name | Description |
stub |
VectorSearchServiceStub |
Methods
awaitTermination(long duration, TimeUnit unit)
public boolean awaitTermination(long duration, TimeUnit unit)| Parameters | |
|---|---|
| Name | Description |
duration |
long |
unit |
TimeUnit |
| Returns | |
|---|---|
| Type | Description |
boolean |
|
| Exceptions | |
|---|---|
| Type | Description |
InterruptedException |
|
close()
public final void close()createCollectionAsync(CreateCollectionRequest request)
public final OperationFuture<Collection,OperationMetadata> createCollectionAsync(CreateCollectionRequest request)Creates a new Collection in a given project and location.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) {
CreateCollectionRequest request =
CreateCollectionRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setCollectionId("collectionId1636075609")
.setCollection(Collection.newBuilder().build())
.setRequestId("requestId693933066")
.build();
Collection response = vectorSearchServiceClient.createCollectionAsync(request).get();
}
| Parameter | |
|---|---|
| Name | Description |
request |
CreateCollectionRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
OperationFuture<Collection,OperationMetadata> |
|
createCollectionAsync(LocationName parent, Collection collection, String collectionId)
public final OperationFuture<Collection,OperationMetadata> createCollectionAsync(LocationName parent, Collection collection, String collectionId)Creates a new Collection in a given project and location.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
Collection collection = Collection.newBuilder().build();
String collectionId = "collectionId1636075609";
Collection response =
vectorSearchServiceClient.createCollectionAsync(parent, collection, collectionId).get();
}
| Parameters | |
|---|---|
| Name | Description |
parent |
LocationNameRequired. Value for parent. |
collection |
CollectionRequired. The resource being created |
collectionId |
StringRequired. Id of the requesting object If auto-generating Id server-side, remove this field and collection_id from the method_signature of Create RPC |
| Returns | |
|---|---|
| Type | Description |
OperationFuture<Collection,OperationMetadata> |
|
createCollectionAsync(String parent, Collection collection, String collectionId)
public final OperationFuture<Collection,OperationMetadata> createCollectionAsync(String parent, Collection collection, String collectionId)Creates a new Collection in a given project and location.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) {
String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
Collection collection = Collection.newBuilder().build();
String collectionId = "collectionId1636075609";
Collection response =
vectorSearchServiceClient.createCollectionAsync(parent, collection, collectionId).get();
}
| Parameters | |
|---|---|
| Name | Description |
parent |
StringRequired. Value for parent. |
collection |
CollectionRequired. The resource being created |
collectionId |
StringRequired. Id of the requesting object If auto-generating Id server-side, remove this field and collection_id from the method_signature of Create RPC |
| Returns | |
|---|---|
| Type | Description |
OperationFuture<Collection,OperationMetadata> |
|
createCollectionCallable()
public final UnaryCallable<CreateCollectionRequest,Operation> createCollectionCallable()Creates a new Collection in a given project and location.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) {
CreateCollectionRequest request =
CreateCollectionRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setCollectionId("collectionId1636075609")
.setCollection(Collection.newBuilder().build())
.setRequestId("requestId693933066")
.build();
ApiFuture<Operation> future =
vectorSearchServiceClient.createCollectionCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<CreateCollectionRequest,Operation> |
|
createCollectionOperationCallable()
public final OperationCallable<CreateCollectionRequest,Collection,OperationMetadata> createCollectionOperationCallable()Creates a new Collection in a given project and location.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) {
CreateCollectionRequest request =
CreateCollectionRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setCollectionId("collectionId1636075609")
.setCollection(Collection.newBuilder().build())
.setRequestId("requestId693933066")
.build();
OperationFuture<Collection, OperationMetadata> future =
vectorSearchServiceClient.createCollectionOperationCallable().futureCall(request);
// Do something.
Collection response = future.get();
}
| Returns | |
|---|---|
| Type | Description |
OperationCallable<CreateCollectionRequest,Collection,OperationMetadata> |
|
createIndexAsync(CollectionName parent, Index index, String indexId)
public final OperationFuture<Index,OperationMetadata> createIndexAsync(CollectionName parent, Index index, String indexId)Creates a new Index in a given project and location.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) {
CollectionName parent = CollectionName.of("[PROJECT]", "[LOCATION]", "[COLLECTION]");
Index index = Index.newBuilder().build();
String indexId = "indexId1943291277";
Index response = vectorSearchServiceClient.createIndexAsync(parent, index, indexId).get();
}
| Parameters | |
|---|---|
| Name | Description |
parent |
CollectionNameRequired. The resource name of the Collection for which to create the Index.
Format: |
index |
IndexRequired. The resource being created |
indexId |
StringRequired. Id of the requesting object If auto-generating Id server-side, remove this field and index_id from the method_signature of Create RPC |
| Returns | |
|---|---|
| Type | Description |
OperationFuture<Index,OperationMetadata> |
|
createIndexAsync(CreateIndexRequest request)
public final OperationFuture<Index,OperationMetadata> createIndexAsync(CreateIndexRequest request)Creates a new Index in a given project and location.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) {
CreateIndexRequest request =
CreateIndexRequest.newBuilder()
.setParent(CollectionName.of("[PROJECT]", "[LOCATION]", "[COLLECTION]").toString())
.setIndexId("indexId1943291277")
.setIndex(Index.newBuilder().build())
.setRequestId("requestId693933066")
.build();
Index response = vectorSearchServiceClient.createIndexAsync(request).get();
}
| Parameter | |
|---|---|
| Name | Description |
request |
CreateIndexRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
OperationFuture<Index,OperationMetadata> |
|
createIndexAsync(String parent, Index index, String indexId)
public final OperationFuture<Index,OperationMetadata> createIndexAsync(String parent, Index index, String indexId)Creates a new Index in a given project and location.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) {
String parent = CollectionName.of("[PROJECT]", "[LOCATION]", "[COLLECTION]").toString();
Index index = Index.newBuilder().build();
String indexId = "indexId1943291277";
Index response = vectorSearchServiceClient.createIndexAsync(parent, index, indexId).get();
}
| Parameters | |
|---|---|
| Name | Description |
parent |
StringRequired. The resource name of the Collection for which to create the Index.
Format: |
index |
IndexRequired. The resource being created |
indexId |
StringRequired. Id of the requesting object If auto-generating Id server-side, remove this field and index_id from the method_signature of Create RPC |
| Returns | |
|---|---|
| Type | Description |
OperationFuture<Index,OperationMetadata> |
|
createIndexCallable()
public final UnaryCallable<CreateIndexRequest,Operation> createIndexCallable()Creates a new Index in a given project and location.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) {
CreateIndexRequest request =
CreateIndexRequest.newBuilder()
.setParent(CollectionName.of("[PROJECT]", "[LOCATION]", "[COLLECTION]").toString())
.setIndexId("indexId1943291277")
.setIndex(Index.newBuilder().build())
.setRequestId("requestId693933066")
.build();
ApiFuture<Operation> future =
vectorSearchServiceClient.createIndexCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<CreateIndexRequest,Operation> |
|
createIndexOperationCallable()
public final OperationCallable<CreateIndexRequest,Index,OperationMetadata> createIndexOperationCallable()Creates a new Index in a given project and location.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) {
CreateIndexRequest request =
CreateIndexRequest.newBuilder()
.setParent(CollectionName.of("[PROJECT]", "[LOCATION]", "[COLLECTION]").toString())
.setIndexId("indexId1943291277")
.setIndex(Index.newBuilder().build())
.setRequestId("requestId693933066")
.build();
OperationFuture<Index, OperationMetadata> future =
vectorSearchServiceClient.createIndexOperationCallable().futureCall(request);
// Do something.
Index response = future.get();
}
| Returns | |
|---|---|
| Type | Description |
OperationCallable<CreateIndexRequest,Index,OperationMetadata> |
|
deleteCollectionAsync(CollectionName name)
public final OperationFuture<Empty,OperationMetadata> deleteCollectionAsync(CollectionName name)Deletes a single Collection.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) {
CollectionName name = CollectionName.of("[PROJECT]", "[LOCATION]", "[COLLECTION]");
vectorSearchServiceClient.deleteCollectionAsync(name).get();
}
| Parameter | |
|---|---|
| Name | Description |
name |
CollectionNameRequired. Name of the resource |
| Returns | |
|---|---|
| Type | Description |
OperationFuture<Empty,OperationMetadata> |
|
deleteCollectionAsync(DeleteCollectionRequest request)
public final OperationFuture<Empty,OperationMetadata> deleteCollectionAsync(DeleteCollectionRequest request)Deletes a single Collection.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) {
DeleteCollectionRequest request =
DeleteCollectionRequest.newBuilder()
.setName(CollectionName.of("[PROJECT]", "[LOCATION]", "[COLLECTION]").toString())
.setRequestId("requestId693933066")
.build();
vectorSearchServiceClient.deleteCollectionAsync(request).get();
}
| Parameter | |
|---|---|
| Name | Description |
request |
DeleteCollectionRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
OperationFuture<Empty,OperationMetadata> |
|
deleteCollectionAsync(String name)
public final OperationFuture<Empty,OperationMetadata> deleteCollectionAsync(String name)Deletes a single Collection.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) {
String name = CollectionName.of("[PROJECT]", "[LOCATION]", "[COLLECTION]").toString();
vectorSearchServiceClient.deleteCollectionAsync(name).get();
}
| Parameter | |
|---|---|
| Name | Description |
name |
StringRequired. Name of the resource |
| Returns | |
|---|---|
| Type | Description |
OperationFuture<Empty,OperationMetadata> |
|
deleteCollectionCallable()
public final UnaryCallable<DeleteCollectionRequest,Operation> deleteCollectionCallable()Deletes a single Collection.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) {
DeleteCollectionRequest request =
DeleteCollectionRequest.newBuilder()
.setName(CollectionName.of("[PROJECT]", "[LOCATION]", "[COLLECTION]").toString())
.setRequestId("requestId693933066")
.build();
ApiFuture<Operation> future =
vectorSearchServiceClient.deleteCollectionCallable().futureCall(request);
// Do something.
future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<DeleteCollectionRequest,Operation> |
|
deleteCollectionOperationCallable()
public final OperationCallable<DeleteCollectionRequest,Empty,OperationMetadata> deleteCollectionOperationCallable()Deletes a single Collection.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) {
DeleteCollectionRequest request =
DeleteCollectionRequest.newBuilder()
.setName(CollectionName.of("[PROJECT]", "[LOCATION]", "[COLLECTION]").toString())
.setRequestId("requestId693933066")
.build();
OperationFuture<Empty, OperationMetadata> future =
vectorSearchServiceClient.deleteCollectionOperationCallable().futureCall(request);
// Do something.
future.get();
}
| Returns | |
|---|---|
| Type | Description |
OperationCallable<DeleteCollectionRequest,Empty,OperationMetadata> |
|
deleteIndexAsync(DeleteIndexRequest request)
public final OperationFuture<Empty,OperationMetadata> deleteIndexAsync(DeleteIndexRequest request)Deletes a single Index.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) {
DeleteIndexRequest request =
DeleteIndexRequest.newBuilder()
.setName(
IndexName.of("[PROJECT]", "[LOCATION]", "[COLLECTION]", "[INDEX]").toString())
.setRequestId("requestId693933066")
.build();
vectorSearchServiceClient.deleteIndexAsync(request).get();
}
| Parameter | |
|---|---|
| Name | Description |
request |
DeleteIndexRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
OperationFuture<Empty,OperationMetadata> |
|
deleteIndexAsync(IndexName name)
public final OperationFuture<Empty,OperationMetadata> deleteIndexAsync(IndexName name)Deletes a single Index.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) {
IndexName name = IndexName.of("[PROJECT]", "[LOCATION]", "[COLLECTION]", "[INDEX]");
vectorSearchServiceClient.deleteIndexAsync(name).get();
}
| Parameter | |
|---|---|
| Name | Description |
name |
IndexNameRequired. The resource name of the Index to delete. Format:
|
| Returns | |
|---|---|
| Type | Description |
OperationFuture<Empty,OperationMetadata> |
|
deleteIndexAsync(String name)
public final OperationFuture<Empty,OperationMetadata> deleteIndexAsync(String name)Deletes a single Index.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) {
String name = IndexName.of("[PROJECT]", "[LOCATION]", "[COLLECTION]", "[INDEX]").toString();
vectorSearchServiceClient.deleteIndexAsync(name).get();
}
| Parameter | |
|---|---|
| Name | Description |
name |
StringRequired. The resource name of the Index to delete. Format:
|
| Returns | |
|---|---|
| Type | Description |
OperationFuture<Empty,OperationMetadata> |
|
deleteIndexCallable()
public final UnaryCallable<DeleteIndexRequest,Operation> deleteIndexCallable()Deletes a single Index.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) {
DeleteIndexRequest request =
DeleteIndexRequest.newBuilder()
.setName(
IndexName.of("[PROJECT]", "[LOCATION]", "[COLLECTION]", "[INDEX]").toString())
.setRequestId("requestId693933066")
.build();
ApiFuture<Operation> future =
vectorSearchServiceClient.deleteIndexCallable().futureCall(request);
// Do something.
future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<DeleteIndexRequest,Operation> |
|
deleteIndexOperationCallable()
public final OperationCallable<DeleteIndexRequest,Empty,OperationMetadata> deleteIndexOperationCallable()Deletes a single Index.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) {
DeleteIndexRequest request =
DeleteIndexRequest.newBuilder()
.setName(
IndexName.of("[PROJECT]", "[LOCATION]", "[COLLECTION]", "[INDEX]").toString())
.setRequestId("requestId693933066")
.build();
OperationFuture<Empty, OperationMetadata> future =
vectorSearchServiceClient.deleteIndexOperationCallable().futureCall(request);
// Do something.
future.get();
}
| Returns | |
|---|---|
| Type | Description |
OperationCallable<DeleteIndexRequest,Empty,OperationMetadata> |
|
getCollection(CollectionName name)
public final Collection getCollection(CollectionName name)Gets details of a single Collection.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) {
CollectionName name = CollectionName.of("[PROJECT]", "[LOCATION]", "[COLLECTION]");
Collection response = vectorSearchServiceClient.getCollection(name);
}
| Parameter | |
|---|---|
| Name | Description |
name |
CollectionNameRequired. Name of the resource |
| Returns | |
|---|---|
| Type | Description |
Collection |
|
getCollection(GetCollectionRequest request)
public final Collection getCollection(GetCollectionRequest request)Gets details of a single Collection.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) {
GetCollectionRequest request =
GetCollectionRequest.newBuilder()
.setName(CollectionName.of("[PROJECT]", "[LOCATION]", "[COLLECTION]").toString())
.build();
Collection response = vectorSearchServiceClient.getCollection(request);
}
| Parameter | |
|---|---|
| Name | Description |
request |
GetCollectionRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
Collection |
|
getCollection(String name)
public final Collection getCollection(String name)Gets details of a single Collection.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) {
String name = CollectionName.of("[PROJECT]", "[LOCATION]", "[COLLECTION]").toString();
Collection response = vectorSearchServiceClient.getCollection(name);
}
| Parameter | |
|---|---|
| Name | Description |
name |
StringRequired. Name of the resource |
| Returns | |
|---|---|
| Type | Description |
Collection |
|
getCollectionCallable()
public final UnaryCallable<GetCollectionRequest,Collection> getCollectionCallable()Gets details of a single Collection.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) {
GetCollectionRequest request =
GetCollectionRequest.newBuilder()
.setName(CollectionName.of("[PROJECT]", "[LOCATION]", "[COLLECTION]").toString())
.build();
ApiFuture<Collection> future =
vectorSearchServiceClient.getCollectionCallable().futureCall(request);
// Do something.
Collection response = future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<GetCollectionRequest,Collection> |
|
getHttpJsonOperationsClient()
public final OperationsClient getHttpJsonOperationsClient()Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.
| Returns | |
|---|---|
| Type | Description |
OperationsClient |
|
getIndex(GetIndexRequest request)
public final Index getIndex(GetIndexRequest request)Gets details of a single Index.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) {
GetIndexRequest request =
GetIndexRequest.newBuilder()
.setName(
IndexName.of("[PROJECT]", "[LOCATION]", "[COLLECTION]", "[INDEX]").toString())
.build();
Index response = vectorSearchServiceClient.getIndex(request);
}
| Parameter | |
|---|---|
| Name | Description |
request |
GetIndexRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
Index |
|
getIndex(IndexName name)
public final Index getIndex(IndexName name)Gets details of a single Index.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) {
IndexName name = IndexName.of("[PROJECT]", "[LOCATION]", "[COLLECTION]", "[INDEX]");
Index response = vectorSearchServiceClient.getIndex(name);
}
| Parameter | |
|---|---|
| Name | Description |
name |
IndexNameRequired. Name of the resource |
| Returns | |
|---|---|
| Type | Description |
Index |
|
getIndex(String name)
public final Index getIndex(String name)Gets details of a single Index.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) {
String name = IndexName.of("[PROJECT]", "[LOCATION]", "[COLLECTION]", "[INDEX]").toString();
Index response = vectorSearchServiceClient.getIndex(name);
}
| Parameter | |
|---|---|
| Name | Description |
name |
StringRequired. Name of the resource |
| Returns | |
|---|---|
| Type | Description |
Index |
|
getIndexCallable()
public final UnaryCallable<GetIndexRequest,Index> getIndexCallable()Gets details of a single Index.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) {
GetIndexRequest request =
GetIndexRequest.newBuilder()
.setName(
IndexName.of("[PROJECT]", "[LOCATION]", "[COLLECTION]", "[INDEX]").toString())
.build();
ApiFuture<Index> future = vectorSearchServiceClient.getIndexCallable().futureCall(request);
// Do something.
Index response = future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<GetIndexRequest,Index> |
|
getLocation(GetLocationRequest request)
public final Location getLocation(GetLocationRequest request)Gets information about a location.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) {
GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
Location response = vectorSearchServiceClient.getLocation(request);
}
| Parameter | |
|---|---|
| Name | Description |
request |
com.google.cloud.location.GetLocationRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
com.google.cloud.location.Location |
|
getLocationCallable()
public final UnaryCallable<GetLocationRequest,Location> getLocationCallable()Gets information about a location.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) {
GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
ApiFuture<Location> future =
vectorSearchServiceClient.getLocationCallable().futureCall(request);
// Do something.
Location response = future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<com.google.cloud.location.GetLocationRequest,com.google.cloud.location.Location> |
|
getOperationsClient()
public final OperationsClient getOperationsClient()Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.
| Returns | |
|---|---|
| Type | Description |
OperationsClient |
|
getSettings()
public final VectorSearchServiceSettings getSettings()| Returns | |
|---|---|
| Type | Description |
VectorSearchServiceSettings |
|
getStub()
public VectorSearchServiceStub getStub()| Returns | |
|---|---|
| Type | Description |
VectorSearchServiceStub |
|
importDataObjectsAsync(ImportDataObjectsRequest request)
public final OperationFuture<ImportDataObjectsResponse,ImportDataObjectsMetadata> importDataObjectsAsync(ImportDataObjectsRequest request)Initiates a Long-Running Operation to import DataObjects into a Collection.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) {
ImportDataObjectsRequest request =
ImportDataObjectsRequest.newBuilder()
.setName(CollectionName.of("[PROJECT]", "[LOCATION]", "[COLLECTION]").toString())
.build();
ImportDataObjectsResponse response =
vectorSearchServiceClient.importDataObjectsAsync(request).get();
}
| Parameter | |
|---|---|
| Name | Description |
request |
ImportDataObjectsRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
OperationFuture<ImportDataObjectsResponse,ImportDataObjectsMetadata> |
|
importDataObjectsCallable()
public final UnaryCallable<ImportDataObjectsRequest,Operation> importDataObjectsCallable()Initiates a Long-Running Operation to import DataObjects into a Collection.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) {
ImportDataObjectsRequest request =
ImportDataObjectsRequest.newBuilder()
.setName(CollectionName.of("[PROJECT]", "[LOCATION]", "[COLLECTION]").toString())
.build();
ApiFuture<Operation> future =
vectorSearchServiceClient.importDataObjectsCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<ImportDataObjectsRequest,Operation> |
|
importDataObjectsOperationCallable()
public final OperationCallable<ImportDataObjectsRequest,ImportDataObjectsResponse,ImportDataObjectsMetadata> importDataObjectsOperationCallable()Initiates a Long-Running Operation to import DataObjects into a Collection.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) {
ImportDataObjectsRequest request =
ImportDataObjectsRequest.newBuilder()
.setName(CollectionName.of("[PROJECT]", "[LOCATION]", "[COLLECTION]").toString())
.build();
OperationFuture<ImportDataObjectsResponse, ImportDataObjectsMetadata> future =
vectorSearchServiceClient.importDataObjectsOperationCallable().futureCall(request);
// Do something.
ImportDataObjectsResponse response = future.get();
}
| Returns | |
|---|---|
| Type | Description |
OperationCallable<ImportDataObjectsRequest,ImportDataObjectsResponse,ImportDataObjectsMetadata> |
|
isShutdown()
public boolean isShutdown()| Returns | |
|---|---|
| Type | Description |
boolean |
|
isTerminated()
public boolean isTerminated()| Returns | |
|---|---|
| Type | Description |
boolean |
|
listCollections(ListCollectionsRequest request)
public final VectorSearchServiceClient.ListCollectionsPagedResponse listCollections(ListCollectionsRequest request)Lists Collections in a given project and location.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) {
ListCollectionsRequest request =
ListCollectionsRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.build();
for (Collection element : vectorSearchServiceClient.listCollections(request).iterateAll()) {
// doThingsWith(element);
}
}
| Parameter | |
|---|---|
| Name | Description |
request |
ListCollectionsRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
VectorSearchServiceClient.ListCollectionsPagedResponse |
|
listCollections(LocationName parent)
public final VectorSearchServiceClient.ListCollectionsPagedResponse listCollections(LocationName parent)Lists Collections in a given project and location.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
for (Collection element : vectorSearchServiceClient.listCollections(parent).iterateAll()) {
// doThingsWith(element);
}
}
| Parameter | |
|---|---|
| Name | Description |
parent |
LocationNameRequired. Parent value for ListCollectionsRequest |
| Returns | |
|---|---|
| Type | Description |
VectorSearchServiceClient.ListCollectionsPagedResponse |
|
listCollections(String parent)
public final VectorSearchServiceClient.ListCollectionsPagedResponse listCollections(String parent)Lists Collections in a given project and location.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) {
String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
for (Collection element : vectorSearchServiceClient.listCollections(parent).iterateAll()) {
// doThingsWith(element);
}
}
| Parameter | |
|---|---|
| Name | Description |
parent |
StringRequired. Parent value for ListCollectionsRequest |
| Returns | |
|---|---|
| Type | Description |
VectorSearchServiceClient.ListCollectionsPagedResponse |
|
listCollectionsCallable()
public final UnaryCallable<ListCollectionsRequest,ListCollectionsResponse> listCollectionsCallable()Lists Collections in a given project and location.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) {
ListCollectionsRequest request =
ListCollectionsRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.build();
while (true) {
ListCollectionsResponse response =
vectorSearchServiceClient.listCollectionsCallable().call(request);
for (Collection element : response.getCollectionsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<ListCollectionsRequest,ListCollectionsResponse> |
|
listCollectionsPagedCallable()
public final UnaryCallable<ListCollectionsRequest,VectorSearchServiceClient.ListCollectionsPagedResponse> listCollectionsPagedCallable()Lists Collections in a given project and location.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) {
ListCollectionsRequest request =
ListCollectionsRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.build();
ApiFuture<Collection> future =
vectorSearchServiceClient.listCollectionsPagedCallable().futureCall(request);
// Do something.
for (Collection element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<ListCollectionsRequest,ListCollectionsPagedResponse> |
|
listIndexes(CollectionName parent)
public final VectorSearchServiceClient.ListIndexesPagedResponse listIndexes(CollectionName parent)Lists Indexes in a given project and location.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) {
CollectionName parent = CollectionName.of("[PROJECT]", "[LOCATION]", "[COLLECTION]");
for (Index element : vectorSearchServiceClient.listIndexes(parent).iterateAll()) {
// doThingsWith(element);
}
}
| Parameter | |
|---|---|
| Name | Description |
parent |
CollectionNameRequired. Parent value for ListIndexesRequest |
| Returns | |
|---|---|
| Type | Description |
VectorSearchServiceClient.ListIndexesPagedResponse |
|
listIndexes(ListIndexesRequest request)
public final VectorSearchServiceClient.ListIndexesPagedResponse listIndexes(ListIndexesRequest request)Lists Indexes in a given project and location.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) {
ListIndexesRequest request =
ListIndexesRequest.newBuilder()
.setParent(CollectionName.of("[PROJECT]", "[LOCATION]", "[COLLECTION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.build();
for (Index element : vectorSearchServiceClient.listIndexes(request).iterateAll()) {
// doThingsWith(element);
}
}
| Parameter | |
|---|---|
| Name | Description |
request |
ListIndexesRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
VectorSearchServiceClient.ListIndexesPagedResponse |
|
listIndexes(String parent)
public final VectorSearchServiceClient.ListIndexesPagedResponse listIndexes(String parent)Lists Indexes in a given project and location.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) {
String parent = CollectionName.of("[PROJECT]", "[LOCATION]", "[COLLECTION]").toString();
for (Index element : vectorSearchServiceClient.listIndexes(parent).iterateAll()) {
// doThingsWith(element);
}
}
| Parameter | |
|---|---|
| Name | Description |
parent |
StringRequired. Parent value for ListIndexesRequest |
| Returns | |
|---|---|
| Type | Description |
VectorSearchServiceClient.ListIndexesPagedResponse |
|
listIndexesCallable()
public final UnaryCallable<ListIndexesRequest,ListIndexesResponse> listIndexesCallable()Lists Indexes in a given project and location.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) {
ListIndexesRequest request =
ListIndexesRequest.newBuilder()
.setParent(CollectionName.of("[PROJECT]", "[LOCATION]", "[COLLECTION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.build();
while (true) {
ListIndexesResponse response =
vectorSearchServiceClient.listIndexesCallable().call(request);
for (Index element : response.getIndexesList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<ListIndexesRequest,ListIndexesResponse> |
|
listIndexesPagedCallable()
public final UnaryCallable<ListIndexesRequest,VectorSearchServiceClient.ListIndexesPagedResponse> listIndexesPagedCallable()Lists Indexes in a given project and location.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) {
ListIndexesRequest request =
ListIndexesRequest.newBuilder()
.setParent(CollectionName.of("[PROJECT]", "[LOCATION]", "[COLLECTION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.build();
ApiFuture<Index> future =
vectorSearchServiceClient.listIndexesPagedCallable().futureCall(request);
// Do something.
for (Index element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<ListIndexesRequest,ListIndexesPagedResponse> |
|
listLocations(ListLocationsRequest request)
public final VectorSearchServiceClient.ListLocationsPagedResponse listLocations(ListLocationsRequest request)Lists information about the supported locations for this service.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) {
ListLocationsRequest request =
ListLocationsRequest.newBuilder()
.setName("name3373707")
.setFilter("filter-1274492040")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
for (Location element : vectorSearchServiceClient.listLocations(request).iterateAll()) {
// doThingsWith(element);
}
}
| Parameter | |
|---|---|
| Name | Description |
request |
com.google.cloud.location.ListLocationsRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
VectorSearchServiceClient.ListLocationsPagedResponse |
|
listLocationsCallable()
public final UnaryCallable<ListLocationsRequest,ListLocationsResponse> listLocationsCallable()Lists information about the supported locations for this service.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) {
ListLocationsRequest request =
ListLocationsRequest.newBuilder()
.setName("name3373707")
.setFilter("filter-1274492040")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
while (true) {
ListLocationsResponse response =
vectorSearchServiceClient.listLocationsCallable().call(request);
for (Location element : response.getLocationsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<com.google.cloud.location.ListLocationsRequest,com.google.cloud.location.ListLocationsResponse> |
|
listLocationsPagedCallable()
public final UnaryCallable<ListLocationsRequest,VectorSearchServiceClient.ListLocationsPagedResponse> listLocationsPagedCallable()Lists information about the supported locations for this service.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) {
ListLocationsRequest request =
ListLocationsRequest.newBuilder()
.setName("name3373707")
.setFilter("filter-1274492040")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
ApiFuture<Location> future =
vectorSearchServiceClient.listLocationsPagedCallable().futureCall(request);
// Do something.
for (Location element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<com.google.cloud.location.ListLocationsRequest,ListLocationsPagedResponse> |
|
shutdown()
public void shutdown()shutdownNow()
public void shutdownNow()updateCollectionAsync(Collection collection, FieldMask updateMask)
public final OperationFuture<Collection,OperationMetadata> updateCollectionAsync(Collection collection, FieldMask updateMask)Updates the parameters of a single Collection.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) {
Collection collection = Collection.newBuilder().build();
FieldMask updateMask = FieldMask.newBuilder().build();
Collection response =
vectorSearchServiceClient.updateCollectionAsync(collection, updateMask).get();
}
| Parameters | |
|---|---|
| Name | Description |
collection |
CollectionRequired. The resource being updated |
updateMask |
FieldMaskOptional. Field mask is used to specify the fields to be overwritten in the Collection resource by the update. The fields specified in the update_mask are relative to the resource, not the full request. A field will be overwritten if it is in the mask. If the user does not provide a mask then all fields present in the request will be overwritten. The following fields support update: If |
| Returns | |
|---|---|
| Type | Description |
OperationFuture<Collection,OperationMetadata> |
|
updateCollectionAsync(UpdateCollectionRequest request)
public final OperationFuture<Collection,OperationMetadata> updateCollectionAsync(UpdateCollectionRequest request)Updates the parameters of a single Collection.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) {
UpdateCollectionRequest request =
UpdateCollectionRequest.newBuilder()
.setUpdateMask(FieldMask.newBuilder().build())
.setCollection(Collection.newBuilder().build())
.setRequestId("requestId693933066")
.build();
Collection response = vectorSearchServiceClient.updateCollectionAsync(request).get();
}
| Parameter | |
|---|---|
| Name | Description |
request |
UpdateCollectionRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
OperationFuture<Collection,OperationMetadata> |
|
updateCollectionCallable()
public final UnaryCallable<UpdateCollectionRequest,Operation> updateCollectionCallable()Updates the parameters of a single Collection.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) {
UpdateCollectionRequest request =
UpdateCollectionRequest.newBuilder()
.setUpdateMask(FieldMask.newBuilder().build())
.setCollection(Collection.newBuilder().build())
.setRequestId("requestId693933066")
.build();
ApiFuture<Operation> future =
vectorSearchServiceClient.updateCollectionCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<UpdateCollectionRequest,Operation> |
|
updateCollectionOperationCallable()
public final OperationCallable<UpdateCollectionRequest,Collection,OperationMetadata> updateCollectionOperationCallable()Updates the parameters of a single Collection.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) {
UpdateCollectionRequest request =
UpdateCollectionRequest.newBuilder()
.setUpdateMask(FieldMask.newBuilder().build())
.setCollection(Collection.newBuilder().build())
.setRequestId("requestId693933066")
.build();
OperationFuture<Collection, OperationMetadata> future =
vectorSearchServiceClient.updateCollectionOperationCallable().futureCall(request);
// Do something.
Collection response = future.get();
}
| Returns | |
|---|---|
| Type | Description |
OperationCallable<UpdateCollectionRequest,Collection,OperationMetadata> |
|