public final class NearestNeighborQuery extends com.google.protobuf.GeneratedMessageV3 implements NearestNeighborQueryOrBuilder
A query to find a number of similar entities.Protobuf type
google.cloud.aiplatform.v1.NearestNeighborQuery| Modifier and Type | Class and Description |
|---|---|
static class |
NearestNeighborQuery.Builder
A query to find a number of similar entities.
|
static class |
NearestNeighborQuery.Embedding
The embedding vector.
|
static interface |
NearestNeighborQuery.EmbeddingOrBuilder |
static class |
NearestNeighborQuery.InstanceCase |
static class |
NearestNeighborQuery.NumericFilter
Numeric filter is used to search a subset of the entities by using boolean
rules on numeric columns.
|
static interface |
NearestNeighborQuery.NumericFilterOrBuilder |
static class |
NearestNeighborQuery.Parameters
Parameters that can be overrided in each query to tune query latency and
recall.
|
static interface |
NearestNeighborQuery.ParametersOrBuilder |
static class |
NearestNeighborQuery.StringFilter
String filter is used to search a subset of the entities by using boolean
rules on string columns.
|
static interface |
NearestNeighborQuery.StringFilterOrBuilder |
com.google.protobuf.GeneratedMessageV3.BuilderParent, com.google.protobuf.GeneratedMessageV3.ExtendableBuilder<MessageT extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage<MessageT>,BuilderT extends com.google.protobuf.GeneratedMessageV3.ExtendableBuilder<MessageT,BuilderT>>, com.google.protobuf.GeneratedMessageV3.ExtendableMessage<MessageT extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage<MessageT>>, com.google.protobuf.GeneratedMessageV3.ExtendableMessageOrBuilder<MessageT extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage<MessageT>>, com.google.protobuf.GeneratedMessageV3.FieldAccessorTable, com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter| Modifier and Type | Field and Description |
|---|---|
static int |
EMBEDDING_FIELD_NUMBER |
static int |
ENTITY_ID_FIELD_NUMBER |
static int |
NEIGHBOR_COUNT_FIELD_NUMBER |
static int |
NUMERIC_FILTERS_FIELD_NUMBER |
static int |
PARAMETERS_FIELD_NUMBER |
static int |
PER_CROWDING_ATTRIBUTE_NEIGHBOR_COUNT_FIELD_NUMBER |
static int |
STRING_FILTERS_FIELD_NUMBER |
canUseUnsafe, computeStringSize, computeStringSizeNoTag, emptyBooleanList, emptyDoubleList, emptyFloatList, emptyIntList, emptyList, emptyLongList, getAllFields, getDescriptorForType, getField, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof, internalGetMapField, internalGetMapFieldReflection, isStringEmpty, makeExtensionsImmutable, makeMutableCopy, makeMutableCopy, mergeFromAndMakeImmutableInternal, mutableCopy, mutableCopy, mutableCopy, mutableCopy, mutableCopy, newBooleanList, newBuilderForType, newDoubleList, newFloatList, newIntList, newLongList, parseDelimitedWithIOException, parseDelimitedWithIOException, parseUnknownField, parseUnknownFieldProto3, parseWithIOException, parseWithIOException, parseWithIOException, parseWithIOException, serializeBooleanMapTo, serializeIntegerMapTo, serializeLongMapTo, serializeStringMapTo, writeReplace, writeString, writeStringNoTagfindInitializationErrors, getInitializationErrorString, hashBoolean, hashEnum, hashEnumList, hashFields, hashLong, toStringaddAll, addAll, checkByteStringIsUtf8, toByteArray, toByteString, writeDelimitedTo, writeToclone, finalize, getClass, notify, notifyAll, wait, wait, waitpublic static final int ENTITY_ID_FIELD_NUMBER
public static final int EMBEDDING_FIELD_NUMBER
public static final int NEIGHBOR_COUNT_FIELD_NUMBER
public static final int STRING_FILTERS_FIELD_NUMBER
public static final int NUMERIC_FILTERS_FIELD_NUMBER
public static final int PER_CROWDING_ATTRIBUTE_NEIGHBOR_COUNT_FIELD_NUMBER
public static final int PARAMETERS_FIELD_NUMBER
protected Object newInstance(com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter unused)
newInstance in class com.google.protobuf.GeneratedMessageV3public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessageV3public NearestNeighborQuery.InstanceCase getInstanceCase()
getInstanceCase in interface NearestNeighborQueryOrBuilderpublic boolean hasEntityId()
Optional. The entity id whose similar entities should be searched for. If embedding is set, search will use embedding instead of entity_id.
string entity_id = 1 [(.google.api.field_behavior) = OPTIONAL];hasEntityId in interface NearestNeighborQueryOrBuilderpublic String getEntityId()
Optional. The entity id whose similar entities should be searched for. If embedding is set, search will use embedding instead of entity_id.
string entity_id = 1 [(.google.api.field_behavior) = OPTIONAL];getEntityId in interface NearestNeighborQueryOrBuilderpublic com.google.protobuf.ByteString getEntityIdBytes()
Optional. The entity id whose similar entities should be searched for. If embedding is set, search will use embedding instead of entity_id.
string entity_id = 1 [(.google.api.field_behavior) = OPTIONAL];getEntityIdBytes in interface NearestNeighborQueryOrBuilderpublic boolean hasEmbedding()
Optional. The embedding vector that be used for similar search.
.google.cloud.aiplatform.v1.NearestNeighborQuery.Embedding embedding = 2 [(.google.api.field_behavior) = OPTIONAL];
hasEmbedding in interface NearestNeighborQueryOrBuilderpublic NearestNeighborQuery.Embedding getEmbedding()
Optional. The embedding vector that be used for similar search.
.google.cloud.aiplatform.v1.NearestNeighborQuery.Embedding embedding = 2 [(.google.api.field_behavior) = OPTIONAL];
getEmbedding in interface NearestNeighborQueryOrBuilderpublic NearestNeighborQuery.EmbeddingOrBuilder getEmbeddingOrBuilder()
Optional. The embedding vector that be used for similar search.
.google.cloud.aiplatform.v1.NearestNeighborQuery.Embedding embedding = 2 [(.google.api.field_behavior) = OPTIONAL];
getEmbeddingOrBuilder in interface NearestNeighborQueryOrBuilderpublic int getNeighborCount()
Optional. The number of similar entities to be retrieved from feature view for each query.
int32 neighbor_count = 3 [(.google.api.field_behavior) = OPTIONAL];getNeighborCount in interface NearestNeighborQueryOrBuilderpublic List<NearestNeighborQuery.StringFilter> getStringFiltersList()
Optional. The list of string filters.
repeated .google.cloud.aiplatform.v1.NearestNeighborQuery.StringFilter string_filters = 4 [(.google.api.field_behavior) = OPTIONAL];
getStringFiltersList in interface NearestNeighborQueryOrBuilderpublic List<? extends NearestNeighborQuery.StringFilterOrBuilder> getStringFiltersOrBuilderList()
Optional. The list of string filters.
repeated .google.cloud.aiplatform.v1.NearestNeighborQuery.StringFilter string_filters = 4 [(.google.api.field_behavior) = OPTIONAL];
getStringFiltersOrBuilderList in interface NearestNeighborQueryOrBuilderpublic int getStringFiltersCount()
Optional. The list of string filters.
repeated .google.cloud.aiplatform.v1.NearestNeighborQuery.StringFilter string_filters = 4 [(.google.api.field_behavior) = OPTIONAL];
getStringFiltersCount in interface NearestNeighborQueryOrBuilderpublic NearestNeighborQuery.StringFilter getStringFilters(int index)
Optional. The list of string filters.
repeated .google.cloud.aiplatform.v1.NearestNeighborQuery.StringFilter string_filters = 4 [(.google.api.field_behavior) = OPTIONAL];
getStringFilters in interface NearestNeighborQueryOrBuilderpublic NearestNeighborQuery.StringFilterOrBuilder getStringFiltersOrBuilder(int index)
Optional. The list of string filters.
repeated .google.cloud.aiplatform.v1.NearestNeighborQuery.StringFilter string_filters = 4 [(.google.api.field_behavior) = OPTIONAL];
getStringFiltersOrBuilder in interface NearestNeighborQueryOrBuilderpublic List<NearestNeighborQuery.NumericFilter> getNumericFiltersList()
Optional. The list of numeric filters.
repeated .google.cloud.aiplatform.v1.NearestNeighborQuery.NumericFilter numeric_filters = 8 [(.google.api.field_behavior) = OPTIONAL];
getNumericFiltersList in interface NearestNeighborQueryOrBuilderpublic List<? extends NearestNeighborQuery.NumericFilterOrBuilder> getNumericFiltersOrBuilderList()
Optional. The list of numeric filters.
repeated .google.cloud.aiplatform.v1.NearestNeighborQuery.NumericFilter numeric_filters = 8 [(.google.api.field_behavior) = OPTIONAL];
getNumericFiltersOrBuilderList in interface NearestNeighborQueryOrBuilderpublic int getNumericFiltersCount()
Optional. The list of numeric filters.
repeated .google.cloud.aiplatform.v1.NearestNeighborQuery.NumericFilter numeric_filters = 8 [(.google.api.field_behavior) = OPTIONAL];
getNumericFiltersCount in interface NearestNeighborQueryOrBuilderpublic NearestNeighborQuery.NumericFilter getNumericFilters(int index)
Optional. The list of numeric filters.
repeated .google.cloud.aiplatform.v1.NearestNeighborQuery.NumericFilter numeric_filters = 8 [(.google.api.field_behavior) = OPTIONAL];
getNumericFilters in interface NearestNeighborQueryOrBuilderpublic NearestNeighborQuery.NumericFilterOrBuilder getNumericFiltersOrBuilder(int index)
Optional. The list of numeric filters.
repeated .google.cloud.aiplatform.v1.NearestNeighborQuery.NumericFilter numeric_filters = 8 [(.google.api.field_behavior) = OPTIONAL];
getNumericFiltersOrBuilder in interface NearestNeighborQueryOrBuilderpublic int getPerCrowdingAttributeNeighborCount()
Optional. Crowding is a constraint on a neighbor list produced by nearest neighbor search requiring that no more than sper_crowding_attribute_neighbor_count of the k neighbors returned have the same value of crowding_attribute. It's used for improving result diversity.
int32 per_crowding_attribute_neighbor_count = 5 [(.google.api.field_behavior) = OPTIONAL];
getPerCrowdingAttributeNeighborCount in interface NearestNeighborQueryOrBuilderpublic boolean hasParameters()
Optional. Parameters that can be set to tune query on the fly.
.google.cloud.aiplatform.v1.NearestNeighborQuery.Parameters parameters = 7 [(.google.api.field_behavior) = OPTIONAL];
hasParameters in interface NearestNeighborQueryOrBuilderpublic NearestNeighborQuery.Parameters getParameters()
Optional. Parameters that can be set to tune query on the fly.
.google.cloud.aiplatform.v1.NearestNeighborQuery.Parameters parameters = 7 [(.google.api.field_behavior) = OPTIONAL];
getParameters in interface NearestNeighborQueryOrBuilderpublic NearestNeighborQuery.ParametersOrBuilder getParametersOrBuilder()
Optional. Parameters that can be set to tune query on the fly.
.google.cloud.aiplatform.v1.NearestNeighborQuery.Parameters parameters = 7 [(.google.api.field_behavior) = OPTIONAL];
getParametersOrBuilder in interface NearestNeighborQueryOrBuilderpublic final boolean isInitialized()
isInitialized in interface com.google.protobuf.MessageLiteOrBuilderisInitialized in class com.google.protobuf.GeneratedMessageV3public void writeTo(com.google.protobuf.CodedOutputStream output)
throws IOException
writeTo in interface com.google.protobuf.MessageLitewriteTo in class com.google.protobuf.GeneratedMessageV3IOExceptionpublic int getSerializedSize()
getSerializedSize in interface com.google.protobuf.MessageLitegetSerializedSize in class com.google.protobuf.GeneratedMessageV3public boolean equals(Object obj)
equals in interface com.google.protobuf.Messageequals in class com.google.protobuf.AbstractMessagepublic int hashCode()
hashCode in interface com.google.protobuf.MessagehashCode in class com.google.protobuf.AbstractMessagepublic static NearestNeighborQuery parseFrom(ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static NearestNeighborQuery parseFrom(ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static NearestNeighborQuery parseFrom(com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static NearestNeighborQuery parseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static NearestNeighborQuery parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static NearestNeighborQuery parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static NearestNeighborQuery parseFrom(InputStream input) throws IOException
IOExceptionpublic static NearestNeighborQuery parseFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
IOExceptionpublic static NearestNeighborQuery parseDelimitedFrom(InputStream input) throws IOException
IOExceptionpublic static NearestNeighborQuery parseDelimitedFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
IOExceptionpublic static NearestNeighborQuery parseFrom(com.google.protobuf.CodedInputStream input) throws IOException
IOExceptionpublic static NearestNeighborQuery parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
IOExceptionpublic NearestNeighborQuery.Builder newBuilderForType()
newBuilderForType in interface com.google.protobuf.MessagenewBuilderForType in interface com.google.protobuf.MessageLitepublic static NearestNeighborQuery.Builder newBuilder()
public static NearestNeighborQuery.Builder newBuilder(NearestNeighborQuery prototype)
public NearestNeighborQuery.Builder toBuilder()
toBuilder in interface com.google.protobuf.MessagetoBuilder in interface com.google.protobuf.MessageLiteprotected NearestNeighborQuery.Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)
newBuilderForType in class com.google.protobuf.GeneratedMessageV3public static NearestNeighborQuery getDefaultInstance()
public static com.google.protobuf.Parser<NearestNeighborQuery> parser()
public com.google.protobuf.Parser<NearestNeighborQuery> getParserForType()
getParserForType in interface com.google.protobuf.MessagegetParserForType in interface com.google.protobuf.MessageLitegetParserForType in class com.google.protobuf.GeneratedMessageV3public NearestNeighborQuery getDefaultInstanceForType()
getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuildergetDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilderCopyright © 2025 Google LLC. All rights reserved.