Package com.google.cloud.aiplatform.v1
Class FindNeighborsRequest.Query.Builder
java.lang.Object
com.google.protobuf.AbstractMessageLite.Builder
com.google.protobuf.AbstractMessage.Builder<BuilderT>
com.google.protobuf.GeneratedMessage.Builder<FindNeighborsRequest.Query.Builder>
com.google.cloud.aiplatform.v1.FindNeighborsRequest.Query.Builder
- All Implemented Interfaces:
FindNeighborsRequest.QueryOrBuilder,com.google.protobuf.Message.Builder,com.google.protobuf.MessageLite.Builder,com.google.protobuf.MessageLiteOrBuilder,com.google.protobuf.MessageOrBuilder,Cloneable
- Enclosing class:
- FindNeighborsRequest.Query
public static final class FindNeighborsRequest.Query.Builder
extends com.google.protobuf.GeneratedMessage.Builder<FindNeighborsRequest.Query.Builder>
implements FindNeighborsRequest.QueryOrBuilder
A query to find a number of the nearest neighbors (most similar vectors) of a vector.Protobuf type
google.cloud.aiplatform.v1.FindNeighborsRequest.Query-
Method Summary
Modifier and TypeMethodDescriptionbuild()clear()The number of neighbors to find via approximate search before exact reordering is performed.Required.The fraction of the number of leaves to search, set at query time allows user to tune search performance.The number of nearest neighbors to be retrieved from database for each query.Crowding is a constraint on a neighbor list produced by nearest neighbor search requiring that no more than some value k' of the k neighbors returned have the same value of crowding_attribute.clearRrf()Optional.intThe number of neighbors to find via approximate search before exact reordering is performed.Required.Required.Required.static final com.google.protobuf.Descriptors.Descriptorcom.google.protobuf.Descriptors.DescriptordoubleThe fraction of the number of leaves to search, set at query time allows user to tune search performance.intThe number of nearest neighbors to be retrieved from database for each query.intCrowding is a constraint on a neighbor list produced by nearest neighbor search requiring that no more than some value k' of the k neighbors returned have the same value of crowding_attribute.getRrf()Optional.Optional.Optional.booleanRequired.booleanhasRrf()Optional.protected com.google.protobuf.GeneratedMessage.FieldAccessorTablefinal booleanmergeDatapoint(IndexDatapoint value) Required.mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) mergeFrom(com.google.protobuf.Message other) Optional.setApproximateNeighborCount(int value) The number of neighbors to find via approximate search before exact reordering is performed.setDatapoint(IndexDatapoint value) Required.setDatapoint(IndexDatapoint.Builder builderForValue) Required.setFractionLeafNodesToSearchOverride(double value) The fraction of the number of leaves to search, set at query time allows user to tune search performance.setNeighborCount(int value) The number of nearest neighbors to be retrieved from database for each query.setPerCrowdingAttributeNeighborCount(int value) Crowding is a constraint on a neighbor list produced by nearest neighbor search requiring that no more than some value k' of the k neighbors returned have the same value of crowding_attribute.Optional.setRrf(FindNeighborsRequest.Query.RRF.Builder builderForValue) Optional.Methods inherited from class com.google.protobuf.GeneratedMessage.Builder
addRepeatedField, clearField, clearOneof, clone, getAllFields, getField, getFieldBuilder, getOneofFieldDescriptor, getParentForChildren, getRepeatedField, getRepeatedFieldBuilder, getRepeatedFieldCount, getUnknownFields, getUnknownFieldSetBuilder, hasField, hasOneof, internalGetMapField, internalGetMapFieldReflection, internalGetMutableMapField, internalGetMutableMapFieldReflection, isClean, markClean, mergeUnknownFields, mergeUnknownLengthDelimitedField, mergeUnknownVarintField, newBuilderForField, onBuilt, onChanged, parseUnknownField, setField, setRepeatedField, setUnknownFields, setUnknownFieldSetBuilder, setUnknownFieldsProto3Methods inherited from class com.google.protobuf.AbstractMessage.Builder
findInitializationErrors, getInitializationErrorString, internalMergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, newUninitializedMessageException, toStringMethods inherited from class com.google.protobuf.AbstractMessageLite.Builder
addAll, addAll, mergeDelimitedFrom, mergeDelimitedFrom, mergeFrom, newUninitializedMessageExceptionMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.google.protobuf.Message.Builder
mergeDelimitedFrom, mergeDelimitedFromMethods inherited from interface com.google.protobuf.MessageLite.Builder
mergeFromMethods inherited from interface com.google.protobuf.MessageOrBuilder
findInitializationErrors, getAllFields, getField, getInitializationErrorString, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof
-
Method Details
-
getDescriptor
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() -
internalGetFieldAccessorTable
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()- Specified by:
internalGetFieldAccessorTablein classcom.google.protobuf.GeneratedMessage.Builder<FindNeighborsRequest.Query.Builder>
-
clear
- Specified by:
clearin interfacecom.google.protobuf.Message.Builder- Specified by:
clearin interfacecom.google.protobuf.MessageLite.Builder- Overrides:
clearin classcom.google.protobuf.GeneratedMessage.Builder<FindNeighborsRequest.Query.Builder>
-
getDescriptorForType
public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()- Specified by:
getDescriptorForTypein interfacecom.google.protobuf.Message.Builder- Specified by:
getDescriptorForTypein interfacecom.google.protobuf.MessageOrBuilder- Overrides:
getDescriptorForTypein classcom.google.protobuf.GeneratedMessage.Builder<FindNeighborsRequest.Query.Builder>
-
getDefaultInstanceForType
- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageLiteOrBuilder- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageOrBuilder
-
build
- Specified by:
buildin interfacecom.google.protobuf.Message.Builder- Specified by:
buildin interfacecom.google.protobuf.MessageLite.Builder
-
buildPartial
- Specified by:
buildPartialin interfacecom.google.protobuf.Message.Builder- Specified by:
buildPartialin interfacecom.google.protobuf.MessageLite.Builder
-
mergeFrom
- Specified by:
mergeFromin interfacecom.google.protobuf.Message.Builder- Overrides:
mergeFromin classcom.google.protobuf.AbstractMessage.Builder<FindNeighborsRequest.Query.Builder>
-
mergeFrom
-
isInitialized
public final boolean isInitialized()- Specified by:
isInitializedin interfacecom.google.protobuf.MessageLiteOrBuilder- Overrides:
isInitializedin classcom.google.protobuf.GeneratedMessage.Builder<FindNeighborsRequest.Query.Builder>
-
mergeFrom
public FindNeighborsRequest.Query.Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException - Specified by:
mergeFromin interfacecom.google.protobuf.Message.Builder- Specified by:
mergeFromin interfacecom.google.protobuf.MessageLite.Builder- Overrides:
mergeFromin classcom.google.protobuf.AbstractMessage.Builder<FindNeighborsRequest.Query.Builder>- Throws:
IOException
-
getRankingCase
- Specified by:
getRankingCasein interfaceFindNeighborsRequest.QueryOrBuilder
-
clearRanking
-
hasRrf
public boolean hasRrf()Optional. Represents RRF algorithm that combines search results.
.google.cloud.aiplatform.v1.FindNeighborsRequest.Query.RRF rrf = 6 [(.google.api.field_behavior) = OPTIONAL];- Specified by:
hasRrfin interfaceFindNeighborsRequest.QueryOrBuilder- Returns:
- Whether the rrf field is set.
-
getRrf
Optional. Represents RRF algorithm that combines search results.
.google.cloud.aiplatform.v1.FindNeighborsRequest.Query.RRF rrf = 6 [(.google.api.field_behavior) = OPTIONAL];- Specified by:
getRrfin interfaceFindNeighborsRequest.QueryOrBuilder- Returns:
- The rrf.
-
setRrf
Optional. Represents RRF algorithm that combines search results.
.google.cloud.aiplatform.v1.FindNeighborsRequest.Query.RRF rrf = 6 [(.google.api.field_behavior) = OPTIONAL]; -
setRrf
public FindNeighborsRequest.Query.Builder setRrf(FindNeighborsRequest.Query.RRF.Builder builderForValue) Optional. Represents RRF algorithm that combines search results.
.google.cloud.aiplatform.v1.FindNeighborsRequest.Query.RRF rrf = 6 [(.google.api.field_behavior) = OPTIONAL]; -
mergeRrf
Optional. Represents RRF algorithm that combines search results.
.google.cloud.aiplatform.v1.FindNeighborsRequest.Query.RRF rrf = 6 [(.google.api.field_behavior) = OPTIONAL]; -
clearRrf
Optional. Represents RRF algorithm that combines search results.
.google.cloud.aiplatform.v1.FindNeighborsRequest.Query.RRF rrf = 6 [(.google.api.field_behavior) = OPTIONAL]; -
getRrfBuilder
Optional. Represents RRF algorithm that combines search results.
.google.cloud.aiplatform.v1.FindNeighborsRequest.Query.RRF rrf = 6 [(.google.api.field_behavior) = OPTIONAL]; -
getRrfOrBuilder
Optional. Represents RRF algorithm that combines search results.
.google.cloud.aiplatform.v1.FindNeighborsRequest.Query.RRF rrf = 6 [(.google.api.field_behavior) = OPTIONAL];- Specified by:
getRrfOrBuilderin interfaceFindNeighborsRequest.QueryOrBuilder
-
hasDatapoint
public boolean hasDatapoint()Required. The datapoint/vector whose nearest neighbors should be searched for.
.google.cloud.aiplatform.v1.IndexDatapoint datapoint = 1 [(.google.api.field_behavior) = REQUIRED];- Specified by:
hasDatapointin interfaceFindNeighborsRequest.QueryOrBuilder- Returns:
- Whether the datapoint field is set.
-
getDatapoint
Required. The datapoint/vector whose nearest neighbors should be searched for.
.google.cloud.aiplatform.v1.IndexDatapoint datapoint = 1 [(.google.api.field_behavior) = REQUIRED];- Specified by:
getDatapointin interfaceFindNeighborsRequest.QueryOrBuilder- Returns:
- The datapoint.
-
setDatapoint
Required. The datapoint/vector whose nearest neighbors should be searched for.
.google.cloud.aiplatform.v1.IndexDatapoint datapoint = 1 [(.google.api.field_behavior) = REQUIRED]; -
setDatapoint
Required. The datapoint/vector whose nearest neighbors should be searched for.
.google.cloud.aiplatform.v1.IndexDatapoint datapoint = 1 [(.google.api.field_behavior) = REQUIRED]; -
mergeDatapoint
Required. The datapoint/vector whose nearest neighbors should be searched for.
.google.cloud.aiplatform.v1.IndexDatapoint datapoint = 1 [(.google.api.field_behavior) = REQUIRED]; -
clearDatapoint
Required. The datapoint/vector whose nearest neighbors should be searched for.
.google.cloud.aiplatform.v1.IndexDatapoint datapoint = 1 [(.google.api.field_behavior) = REQUIRED]; -
getDatapointBuilder
Required. The datapoint/vector whose nearest neighbors should be searched for.
.google.cloud.aiplatform.v1.IndexDatapoint datapoint = 1 [(.google.api.field_behavior) = REQUIRED]; -
getDatapointOrBuilder
Required. The datapoint/vector whose nearest neighbors should be searched for.
.google.cloud.aiplatform.v1.IndexDatapoint datapoint = 1 [(.google.api.field_behavior) = REQUIRED];- Specified by:
getDatapointOrBuilderin interfaceFindNeighborsRequest.QueryOrBuilder
-
getNeighborCount
public int getNeighborCount()The number of nearest neighbors to be retrieved from database for each query. If not set, will use the default from the service configuration (https://cloud.google.com/vertex-ai/docs/matching-engine/configuring-indexes#nearest-neighbor-search-config).
int32 neighbor_count = 2;- Specified by:
getNeighborCountin interfaceFindNeighborsRequest.QueryOrBuilder- Returns:
- The neighborCount.
-
setNeighborCount
The number of nearest neighbors to be retrieved from database for each query. If not set, will use the default from the service configuration (https://cloud.google.com/vertex-ai/docs/matching-engine/configuring-indexes#nearest-neighbor-search-config).
int32 neighbor_count = 2;- Parameters:
value- The neighborCount to set.- Returns:
- This builder for chaining.
-
clearNeighborCount
The number of nearest neighbors to be retrieved from database for each query. If not set, will use the default from the service configuration (https://cloud.google.com/vertex-ai/docs/matching-engine/configuring-indexes#nearest-neighbor-search-config).
int32 neighbor_count = 2;- Returns:
- This builder for chaining.
-
getPerCrowdingAttributeNeighborCount
public int getPerCrowdingAttributeNeighborCount()Crowding is a constraint on a neighbor list produced by nearest neighbor search requiring that no more than some value k' of the k neighbors returned have the same value of crowding_attribute. It's used for improving result diversity. This field is the maximum number of matches with the same crowding tag.
int32 per_crowding_attribute_neighbor_count = 3;- Specified by:
getPerCrowdingAttributeNeighborCountin interfaceFindNeighborsRequest.QueryOrBuilder- Returns:
- The perCrowdingAttributeNeighborCount.
-
setPerCrowdingAttributeNeighborCount
Crowding is a constraint on a neighbor list produced by nearest neighbor search requiring that no more than some value k' of the k neighbors returned have the same value of crowding_attribute. It's used for improving result diversity. This field is the maximum number of matches with the same crowding tag.
int32 per_crowding_attribute_neighbor_count = 3;- Parameters:
value- The perCrowdingAttributeNeighborCount to set.- Returns:
- This builder for chaining.
-
clearPerCrowdingAttributeNeighborCount
Crowding is a constraint on a neighbor list produced by nearest neighbor search requiring that no more than some value k' of the k neighbors returned have the same value of crowding_attribute. It's used for improving result diversity. This field is the maximum number of matches with the same crowding tag.
int32 per_crowding_attribute_neighbor_count = 3;- Returns:
- This builder for chaining.
-
getApproximateNeighborCount
public int getApproximateNeighborCount()The number of neighbors to find via approximate search before exact reordering is performed. If not set, the default value from scam config is used; if set, this value must be > 0.
int32 approximate_neighbor_count = 4;- Specified by:
getApproximateNeighborCountin interfaceFindNeighborsRequest.QueryOrBuilder- Returns:
- The approximateNeighborCount.
-
setApproximateNeighborCount
The number of neighbors to find via approximate search before exact reordering is performed. If not set, the default value from scam config is used; if set, this value must be > 0.
int32 approximate_neighbor_count = 4;- Parameters:
value- The approximateNeighborCount to set.- Returns:
- This builder for chaining.
-
clearApproximateNeighborCount
The number of neighbors to find via approximate search before exact reordering is performed. If not set, the default value from scam config is used; if set, this value must be > 0.
int32 approximate_neighbor_count = 4;- Returns:
- This builder for chaining.
-
getFractionLeafNodesToSearchOverride
public double getFractionLeafNodesToSearchOverride()The fraction of the number of leaves to search, set at query time allows user to tune search performance. This value increase result in both search accuracy and latency increase. The value should be between 0.0 and 1.0. If not set or set to 0.0, query uses the default value specified in NearestNeighborSearchConfig.TreeAHConfig.fraction_leaf_nodes_to_search.
double fraction_leaf_nodes_to_search_override = 5;- Specified by:
getFractionLeafNodesToSearchOverridein interfaceFindNeighborsRequest.QueryOrBuilder- Returns:
- The fractionLeafNodesToSearchOverride.
-
setFractionLeafNodesToSearchOverride
The fraction of the number of leaves to search, set at query time allows user to tune search performance. This value increase result in both search accuracy and latency increase. The value should be between 0.0 and 1.0. If not set or set to 0.0, query uses the default value specified in NearestNeighborSearchConfig.TreeAHConfig.fraction_leaf_nodes_to_search.
double fraction_leaf_nodes_to_search_override = 5;- Parameters:
value- The fractionLeafNodesToSearchOverride to set.- Returns:
- This builder for chaining.
-
clearFractionLeafNodesToSearchOverride
The fraction of the number of leaves to search, set at query time allows user to tune search performance. This value increase result in both search accuracy and latency increase. The value should be between 0.0 and 1.0. If not set or set to 0.0, query uses the default value specified in NearestNeighborSearchConfig.TreeAHConfig.fraction_leaf_nodes_to_search.
double fraction_leaf_nodes_to_search_override = 5;- Returns:
- This builder for chaining.
-