Class NearestNeighborQuery (3.38.0)

public final class NearestNeighborQuery extends GeneratedMessageV3 implements NearestNeighborQueryOrBuilder

A query to find a number of similar entities.

Protobuf type google.cloud.aiplatform.v1.NearestNeighborQuery

Static Fields

EMBEDDING_FIELD_NUMBER

public static final int EMBEDDING_FIELD_NUMBER
Field Value
TypeDescription
int

ENTITY_ID_FIELD_NUMBER

public static final int ENTITY_ID_FIELD_NUMBER
Field Value
TypeDescription
int

NEIGHBOR_COUNT_FIELD_NUMBER

public static final int NEIGHBOR_COUNT_FIELD_NUMBER
Field Value
TypeDescription
int

PARAMETERS_FIELD_NUMBER

public static final int PARAMETERS_FIELD_NUMBER
Field Value
TypeDescription
int

PER_CROWDING_ATTRIBUTE_NEIGHBOR_COUNT_FIELD_NUMBER

public static final int PER_CROWDING_ATTRIBUTE_NEIGHBOR_COUNT_FIELD_NUMBER
Field Value
TypeDescription
int

STRING_FILTERS_FIELD_NUMBER

public static final int STRING_FILTERS_FIELD_NUMBER
Field Value
TypeDescription
int

Static Methods

getDefaultInstance()

public static NearestNeighborQuery getDefaultInstance()
Returns
TypeDescription
NearestNeighborQuery

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
TypeDescription
Descriptor

newBuilder()

public static NearestNeighborQuery.Builder newBuilder()
Returns
TypeDescription
NearestNeighborQuery.Builder

newBuilder(NearestNeighborQuery prototype)

public static NearestNeighborQuery.Builder newBuilder(NearestNeighborQuery prototype)
Parameter
NameDescription
prototypeNearestNeighborQuery
Returns
TypeDescription
NearestNeighborQuery.Builder

parseDelimitedFrom(InputStream input)

public static NearestNeighborQuery parseDelimitedFrom(InputStream input)
Parameter
NameDescription
inputInputStream
Returns
TypeDescription
NearestNeighborQuery
Exceptions
TypeDescription
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static NearestNeighborQuery parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
NearestNeighborQuery
Exceptions
TypeDescription
IOException

parseFrom(byte[] data)

public static NearestNeighborQuery parseFrom(byte[] data)
Parameter
NameDescription
databyte[]
Returns
TypeDescription
NearestNeighborQuery
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

public static NearestNeighborQuery parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
databyte[]
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
NearestNeighborQuery
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteString data)

public static NearestNeighborQuery parseFrom(ByteString data)
Parameter
NameDescription
dataByteString
Returns
TypeDescription
NearestNeighborQuery
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

public static NearestNeighborQuery parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
dataByteString
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
NearestNeighborQuery
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

public static NearestNeighborQuery parseFrom(CodedInputStream input)
Parameter
NameDescription
inputCodedInputStream
Returns
TypeDescription
NearestNeighborQuery
Exceptions
TypeDescription
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public static NearestNeighborQuery parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
NearestNeighborQuery
Exceptions
TypeDescription
IOException

parseFrom(InputStream input)

public static NearestNeighborQuery parseFrom(InputStream input)
Parameter
NameDescription
inputInputStream
Returns
TypeDescription
NearestNeighborQuery
Exceptions
TypeDescription
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static NearestNeighborQuery parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
NearestNeighborQuery
Exceptions
TypeDescription
IOException

parseFrom(ByteBuffer data)

public static NearestNeighborQuery parseFrom(ByteBuffer data)
Parameter
NameDescription
dataByteBuffer
Returns
TypeDescription
NearestNeighborQuery
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

public static NearestNeighborQuery parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
dataByteBuffer
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
NearestNeighborQuery
Exceptions
TypeDescription
InvalidProtocolBufferException

parser()

public static Parser<NearestNeighborQuery> parser()
Returns
TypeDescription
Parser<NearestNeighborQuery>

Methods

equals(Object obj)

public boolean equals(Object obj)
Parameter
NameDescription
objObject
Returns
TypeDescription
boolean
Overrides

getDefaultInstanceForType()

public NearestNeighborQuery getDefaultInstanceForType()
Returns
TypeDescription
NearestNeighborQuery

getEmbedding()

public 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];

Returns
TypeDescription
NearestNeighborQuery.Embedding

The embedding.

getEmbeddingOrBuilder()

public 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];

Returns
TypeDescription
NearestNeighborQuery.EmbeddingOrBuilder

getEntityId()

public 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];

Returns
TypeDescription
String

The entityId.

getEntityIdBytes()

public 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];

Returns
TypeDescription
ByteString

The bytes for entityId.

getInstanceCase()

public NearestNeighborQuery.InstanceCase getInstanceCase()
Returns
TypeDescription
NearestNeighborQuery.InstanceCase

getNeighborCount()

public 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];

Returns
TypeDescription
int

The neighborCount.

getParameters()

public 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];

Returns
TypeDescription
NearestNeighborQuery.Parameters

The parameters.

getParametersOrBuilder()

public 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];

Returns
TypeDescription
NearestNeighborQuery.ParametersOrBuilder

getParserForType()

public Parser<NearestNeighborQuery> getParserForType()
Returns
TypeDescription
Parser<NearestNeighborQuery>
Overrides

getPerCrowdingAttributeNeighborCount()

public 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];

Returns
TypeDescription
int

The perCrowdingAttributeNeighborCount.

getSerializedSize()

public int getSerializedSize()
Returns
TypeDescription
int
Overrides

getStringFilters(int index)

public 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];

Parameter
NameDescription
indexint
Returns
TypeDescription
NearestNeighborQuery.StringFilter

getStringFiltersCount()

public int getStringFiltersCount()

Optional. The list of string filters.

repeated .google.cloud.aiplatform.v1.NearestNeighborQuery.StringFilter string_filters = 4 [(.google.api.field_behavior) = OPTIONAL];

Returns
TypeDescription
int

getStringFiltersList()

public 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];

Returns
TypeDescription
List<StringFilter>

getStringFiltersOrBuilder(int index)

public 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];

Parameter
NameDescription
indexint
Returns
TypeDescription
NearestNeighborQuery.StringFilterOrBuilder

getStringFiltersOrBuilderList()

public 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];

Returns
TypeDescription
List<? extends com.google.cloud.aiplatform.v1.NearestNeighborQuery.StringFilterOrBuilder>

hasEmbedding()

public 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];

Returns
TypeDescription
boolean

Whether the embedding field is set.

hasEntityId()

public 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];

Returns
TypeDescription
boolean

Whether the entityId field is set.

hasParameters()

public 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];

Returns
TypeDescription
boolean

Whether the parameters field is set.

hashCode()

public int hashCode()
Returns
TypeDescription
int
Overrides

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

newBuilderForType()

public NearestNeighborQuery.Builder newBuilderForType()
Returns
TypeDescription
NearestNeighborQuery.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

protected NearestNeighborQuery.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Parameter
NameDescription
parentBuilderParent
Returns
TypeDescription
NearestNeighborQuery.Builder
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Parameter
NameDescription
unusedUnusedPrivateParameter
Returns
TypeDescription
Object
Overrides

toBuilder()

public NearestNeighborQuery.Builder toBuilder()
Returns
TypeDescription
NearestNeighborQuery.Builder

writeTo(CodedOutputStream output)

public void writeTo(CodedOutputStream output)
Parameter
NameDescription
outputCodedOutputStream
Overrides
Exceptions
TypeDescription
IOException