Class NearestNeighborQuery.Builder (3.38.0)

public static final class NearestNeighborQuery.Builder extends GeneratedMessageV3.Builder<NearestNeighborQuery.Builder> implements NearestNeighborQueryOrBuilder

A query to find a number of similar entities.

Protobuf type google.cloud.aiplatform.v1.NearestNeighborQuery

Static Methods

getDescriptor()

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

Methods

addAllStringFilters(Iterable<? extends NearestNeighborQuery.StringFilter> values)

public NearestNeighborQuery.Builder addAllStringFilters(Iterable<? extends NearestNeighborQuery.StringFilter> values)

Optional. The list of string filters.

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

Parameter
NameDescription
valuesIterable<? extends com.google.cloud.aiplatform.v1.NearestNeighborQuery.StringFilter>
Returns
TypeDescription
NearestNeighborQuery.Builder

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public NearestNeighborQuery.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
NearestNeighborQuery.Builder
Overrides

addStringFilters(NearestNeighborQuery.StringFilter value)

public NearestNeighborQuery.Builder addStringFilters(NearestNeighborQuery.StringFilter value)

Optional. The list of string filters.

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

Parameter
NameDescription
valueNearestNeighborQuery.StringFilter
Returns
TypeDescription
NearestNeighborQuery.Builder

addStringFilters(NearestNeighborQuery.StringFilter.Builder builderForValue)

public NearestNeighborQuery.Builder addStringFilters(NearestNeighborQuery.StringFilter.Builder builderForValue)

Optional. The list of string filters.

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

Parameter
NameDescription
builderForValueNearestNeighborQuery.StringFilter.Builder
Returns
TypeDescription
NearestNeighborQuery.Builder

addStringFilters(int index, NearestNeighborQuery.StringFilter value)

public NearestNeighborQuery.Builder addStringFilters(int index, NearestNeighborQuery.StringFilter value)

Optional. The list of string filters.

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

Parameters
NameDescription
indexint
valueNearestNeighborQuery.StringFilter
Returns
TypeDescription
NearestNeighborQuery.Builder

addStringFilters(int index, NearestNeighborQuery.StringFilter.Builder builderForValue)

public NearestNeighborQuery.Builder addStringFilters(int index, NearestNeighborQuery.StringFilter.Builder builderForValue)

Optional. The list of string filters.

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

Parameters
NameDescription
indexint
builderForValueNearestNeighborQuery.StringFilter.Builder
Returns
TypeDescription
NearestNeighborQuery.Builder

addStringFiltersBuilder()

public NearestNeighborQuery.StringFilter.Builder addStringFiltersBuilder()

Optional. The list of string filters.

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

Returns
TypeDescription
NearestNeighborQuery.StringFilter.Builder

addStringFiltersBuilder(int index)

public NearestNeighborQuery.StringFilter.Builder addStringFiltersBuilder(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.Builder

build()

public NearestNeighborQuery build()
Returns
TypeDescription
NearestNeighborQuery

buildPartial()

public NearestNeighborQuery buildPartial()
Returns
TypeDescription
NearestNeighborQuery

clear()

public NearestNeighborQuery.Builder clear()
Returns
TypeDescription
NearestNeighborQuery.Builder
Overrides

clearEmbedding()

public NearestNeighborQuery.Builder clearEmbedding()

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.Builder

clearEntityId()

public NearestNeighborQuery.Builder clearEntityId()

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
NearestNeighborQuery.Builder

This builder for chaining.

clearField(Descriptors.FieldDescriptor field)

public NearestNeighborQuery.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
NameDescription
fieldFieldDescriptor
Returns
TypeDescription
NearestNeighborQuery.Builder
Overrides

clearInstance()

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

clearNeighborCount()

public NearestNeighborQuery.Builder clearNeighborCount()

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
NearestNeighborQuery.Builder

This builder for chaining.

clearOneof(Descriptors.OneofDescriptor oneof)

public NearestNeighborQuery.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
NameDescription
oneofOneofDescriptor
Returns
TypeDescription
NearestNeighborQuery.Builder
Overrides

clearParameters()

public NearestNeighborQuery.Builder clearParameters()

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.Builder

clearPerCrowdingAttributeNeighborCount()

public NearestNeighborQuery.Builder clearPerCrowdingAttributeNeighborCount()

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
NearestNeighborQuery.Builder

This builder for chaining.

clearStringFilters()

public NearestNeighborQuery.Builder clearStringFilters()

Optional. The list of string filters.

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

Returns
TypeDescription
NearestNeighborQuery.Builder

clone()

public NearestNeighborQuery.Builder clone()
Returns
TypeDescription
NearestNeighborQuery.Builder
Overrides

getDefaultInstanceForType()

public NearestNeighborQuery getDefaultInstanceForType()
Returns
TypeDescription
NearestNeighborQuery

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
TypeDescription
Descriptor
Overrides

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.

getEmbeddingBuilder()

public NearestNeighborQuery.Embedding.Builder getEmbeddingBuilder()

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.Builder

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.

getParametersBuilder()

public NearestNeighborQuery.Parameters.Builder getParametersBuilder()

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.Builder

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

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.

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

getStringFiltersBuilder(int index)

public NearestNeighborQuery.StringFilter.Builder getStringFiltersBuilder(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.Builder

getStringFiltersBuilderList()

public List<NearestNeighborQuery.StringFilter.Builder> getStringFiltersBuilderList()

Optional. The list of string filters.

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

Returns
TypeDescription
List<Builder>

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.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

mergeEmbedding(NearestNeighborQuery.Embedding value)

public NearestNeighborQuery.Builder mergeEmbedding(NearestNeighborQuery.Embedding value)

Optional. The embedding vector that be used for similar search.

.google.cloud.aiplatform.v1.NearestNeighborQuery.Embedding embedding = 2 [(.google.api.field_behavior) = OPTIONAL];

Parameter
NameDescription
valueNearestNeighborQuery.Embedding
Returns
TypeDescription
NearestNeighborQuery.Builder

mergeFrom(NearestNeighborQuery other)

public NearestNeighborQuery.Builder mergeFrom(NearestNeighborQuery other)
Parameter
NameDescription
otherNearestNeighborQuery
Returns
TypeDescription
NearestNeighborQuery.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public NearestNeighborQuery.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
NearestNeighborQuery.Builder
Overrides
Exceptions
TypeDescription
IOException

mergeFrom(Message other)

public NearestNeighborQuery.Builder mergeFrom(Message other)
Parameter
NameDescription
otherMessage
Returns
TypeDescription
NearestNeighborQuery.Builder
Overrides

mergeParameters(NearestNeighborQuery.Parameters value)

public NearestNeighborQuery.Builder mergeParameters(NearestNeighborQuery.Parameters value)

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

Parameter
NameDescription
valueNearestNeighborQuery.Parameters
Returns
TypeDescription
NearestNeighborQuery.Builder

mergeUnknownFields(UnknownFieldSet unknownFields)

public final NearestNeighborQuery.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
NearestNeighborQuery.Builder
Overrides

removeStringFilters(int index)

public NearestNeighborQuery.Builder removeStringFilters(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.Builder

setEmbedding(NearestNeighborQuery.Embedding value)

public NearestNeighborQuery.Builder setEmbedding(NearestNeighborQuery.Embedding value)

Optional. The embedding vector that be used for similar search.

.google.cloud.aiplatform.v1.NearestNeighborQuery.Embedding embedding = 2 [(.google.api.field_behavior) = OPTIONAL];

Parameter
NameDescription
valueNearestNeighborQuery.Embedding
Returns
TypeDescription
NearestNeighborQuery.Builder

setEmbedding(NearestNeighborQuery.Embedding.Builder builderForValue)

public NearestNeighborQuery.Builder setEmbedding(NearestNeighborQuery.Embedding.Builder builderForValue)

Optional. The embedding vector that be used for similar search.

.google.cloud.aiplatform.v1.NearestNeighborQuery.Embedding embedding = 2 [(.google.api.field_behavior) = OPTIONAL];

Parameter
NameDescription
builderForValueNearestNeighborQuery.Embedding.Builder
Returns
TypeDescription
NearestNeighborQuery.Builder

setEntityId(String value)

public NearestNeighborQuery.Builder setEntityId(String value)

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

Parameter
NameDescription
valueString

The entityId to set.

Returns
TypeDescription
NearestNeighborQuery.Builder

This builder for chaining.

setEntityIdBytes(ByteString value)

public NearestNeighborQuery.Builder setEntityIdBytes(ByteString value)

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

Parameter
NameDescription
valueByteString

The bytes for entityId to set.

Returns
TypeDescription
NearestNeighborQuery.Builder

This builder for chaining.

setField(Descriptors.FieldDescriptor field, Object value)

public NearestNeighborQuery.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
NearestNeighborQuery.Builder
Overrides

setNeighborCount(int value)

public NearestNeighborQuery.Builder setNeighborCount(int value)

Optional. The number of similar entities to be retrieved from feature view for each query.

int32 neighbor_count = 3 [(.google.api.field_behavior) = OPTIONAL];

Parameter
NameDescription
valueint

The neighborCount to set.

Returns
TypeDescription
NearestNeighborQuery.Builder

This builder for chaining.

setParameters(NearestNeighborQuery.Parameters value)

public NearestNeighborQuery.Builder setParameters(NearestNeighborQuery.Parameters value)

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

Parameter
NameDescription
valueNearestNeighborQuery.Parameters
Returns
TypeDescription
NearestNeighborQuery.Builder

setParameters(NearestNeighborQuery.Parameters.Builder builderForValue)

public NearestNeighborQuery.Builder setParameters(NearestNeighborQuery.Parameters.Builder builderForValue)

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

Parameter
NameDescription
builderForValueNearestNeighborQuery.Parameters.Builder
Returns
TypeDescription
NearestNeighborQuery.Builder

setPerCrowdingAttributeNeighborCount(int value)

public NearestNeighborQuery.Builder setPerCrowdingAttributeNeighborCount(int value)

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

Parameter
NameDescription
valueint

The perCrowdingAttributeNeighborCount to set.

Returns
TypeDescription
NearestNeighborQuery.Builder

This builder for chaining.

setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)

public NearestNeighborQuery.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
NameDescription
fieldFieldDescriptor
indexint
valueObject
Returns
TypeDescription
NearestNeighborQuery.Builder
Overrides

setStringFilters(int index, NearestNeighborQuery.StringFilter value)

public NearestNeighborQuery.Builder setStringFilters(int index, NearestNeighborQuery.StringFilter value)

Optional. The list of string filters.

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

Parameters
NameDescription
indexint
valueNearestNeighborQuery.StringFilter
Returns
TypeDescription
NearestNeighborQuery.Builder

setStringFilters(int index, NearestNeighborQuery.StringFilter.Builder builderForValue)

public NearestNeighborQuery.Builder setStringFilters(int index, NearestNeighborQuery.StringFilter.Builder builderForValue)

Optional. The list of string filters.

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

Parameters
NameDescription
indexint
builderForValueNearestNeighborQuery.StringFilter.Builder
Returns
TypeDescription
NearestNeighborQuery.Builder

setUnknownFields(UnknownFieldSet unknownFields)

public final NearestNeighborQuery.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
NearestNeighborQuery.Builder
Overrides