Class NearestNeighborQuery.Builder (3.49.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
Type Description
Descriptor

Methods

addAllNumericFilters(Iterable<? extends NearestNeighborQuery.NumericFilter> values)

public NearestNeighborQuery.Builder addAllNumericFilters(Iterable<? extends NearestNeighborQuery.NumericFilter> values)

Optional. The list of numeric filters.

repeated .google.cloud.aiplatform.v1.NearestNeighborQuery.NumericFilter numeric_filters = 8 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
values Iterable<? extends com.google.cloud.aiplatform.v1.NearestNeighborQuery.NumericFilter>
Returns
Type Description
NearestNeighborQuery.Builder

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
Name Description
values Iterable<? extends com.google.cloud.aiplatform.v1.NearestNeighborQuery.StringFilter>
Returns
Type Description
NearestNeighborQuery.Builder

addNumericFilters(NearestNeighborQuery.NumericFilter value)

public NearestNeighborQuery.Builder addNumericFilters(NearestNeighborQuery.NumericFilter value)

Optional. The list of numeric filters.

repeated .google.cloud.aiplatform.v1.NearestNeighborQuery.NumericFilter numeric_filters = 8 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
value NearestNeighborQuery.NumericFilter
Returns
Type Description
NearestNeighborQuery.Builder

addNumericFilters(NearestNeighborQuery.NumericFilter.Builder builderForValue)

public NearestNeighborQuery.Builder addNumericFilters(NearestNeighborQuery.NumericFilter.Builder builderForValue)

Optional. The list of numeric filters.

repeated .google.cloud.aiplatform.v1.NearestNeighborQuery.NumericFilter numeric_filters = 8 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
builderForValue NearestNeighborQuery.NumericFilter.Builder
Returns
Type Description
NearestNeighborQuery.Builder

addNumericFilters(int index, NearestNeighborQuery.NumericFilter value)

public NearestNeighborQuery.Builder addNumericFilters(int index, NearestNeighborQuery.NumericFilter value)

Optional. The list of numeric filters.

repeated .google.cloud.aiplatform.v1.NearestNeighborQuery.NumericFilter numeric_filters = 8 [(.google.api.field_behavior) = OPTIONAL];

Parameters
Name Description
index int
value NearestNeighborQuery.NumericFilter
Returns
Type Description
NearestNeighborQuery.Builder

addNumericFilters(int index, NearestNeighborQuery.NumericFilter.Builder builderForValue)

public NearestNeighborQuery.Builder addNumericFilters(int index, NearestNeighborQuery.NumericFilter.Builder builderForValue)

Optional. The list of numeric filters.

repeated .google.cloud.aiplatform.v1.NearestNeighborQuery.NumericFilter numeric_filters = 8 [(.google.api.field_behavior) = OPTIONAL];

Parameters
Name Description
index int
builderForValue NearestNeighborQuery.NumericFilter.Builder
Returns
Type Description
NearestNeighborQuery.Builder

addNumericFiltersBuilder()

public NearestNeighborQuery.NumericFilter.Builder addNumericFiltersBuilder()

Optional. The list of numeric filters.

repeated .google.cloud.aiplatform.v1.NearestNeighborQuery.NumericFilter numeric_filters = 8 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
NearestNeighborQuery.NumericFilter.Builder

addNumericFiltersBuilder(int index)

public NearestNeighborQuery.NumericFilter.Builder addNumericFiltersBuilder(int index)

Optional. The list of numeric filters.

repeated .google.cloud.aiplatform.v1.NearestNeighborQuery.NumericFilter numeric_filters = 8 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
index int
Returns
Type Description
NearestNeighborQuery.NumericFilter.Builder

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public NearestNeighborQuery.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
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
Name Description
value NearestNeighborQuery.StringFilter
Returns
Type Description
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
Name Description
builderForValue NearestNeighborQuery.StringFilter.Builder
Returns
Type Description
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
Name Description
index int
value NearestNeighborQuery.StringFilter
Returns
Type Description
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
Name Description
index int
builderForValue NearestNeighborQuery.StringFilter.Builder
Returns
Type Description
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
Type Description
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
Name Description
index int
Returns
Type Description
NearestNeighborQuery.StringFilter.Builder

build()

public NearestNeighborQuery build()
Returns
Type Description
NearestNeighborQuery

buildPartial()

public NearestNeighborQuery buildPartial()
Returns
Type Description
NearestNeighborQuery

clear()

public NearestNeighborQuery.Builder clear()
Returns
Type Description
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
Type Description
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
Type Description
NearestNeighborQuery.Builder

This builder for chaining.

clearField(Descriptors.FieldDescriptor field)

public NearestNeighborQuery.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
Name Description
field FieldDescriptor
Returns
Type Description
NearestNeighborQuery.Builder
Overrides

clearInstance()

public NearestNeighborQuery.Builder clearInstance()
Returns
Type Description
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
Type Description
NearestNeighborQuery.Builder

This builder for chaining.

clearNumericFilters()

public NearestNeighborQuery.Builder clearNumericFilters()

Optional. The list of numeric filters.

repeated .google.cloud.aiplatform.v1.NearestNeighborQuery.NumericFilter numeric_filters = 8 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
NearestNeighborQuery.Builder

clearOneof(Descriptors.OneofDescriptor oneof)

public NearestNeighborQuery.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
Name Description
oneof OneofDescriptor
Returns
Type Description
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
Type Description
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
Type Description
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
Type Description
NearestNeighborQuery.Builder

clone()

public NearestNeighborQuery.Builder clone()
Returns
Type Description
NearestNeighborQuery.Builder
Overrides

getDefaultInstanceForType()

public NearestNeighborQuery getDefaultInstanceForType()
Returns
Type Description
NearestNeighborQuery

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
Type Description
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
Type Description
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
Type Description
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
Type Description
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
Type Description
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
Type Description
ByteString

The bytes for entityId.

getInstanceCase()

public NearestNeighborQuery.InstanceCase getInstanceCase()
Returns
Type Description
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
Type Description
int

The neighborCount.

getNumericFilters(int index)

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

Parameter
Name Description
index int
Returns
Type Description
NearestNeighborQuery.NumericFilter

getNumericFiltersBuilder(int index)

public NearestNeighborQuery.NumericFilter.Builder getNumericFiltersBuilder(int index)

Optional. The list of numeric filters.

repeated .google.cloud.aiplatform.v1.NearestNeighborQuery.NumericFilter numeric_filters = 8 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
index int
Returns
Type Description
NearestNeighborQuery.NumericFilter.Builder

getNumericFiltersBuilderList()

public List<NearestNeighborQuery.NumericFilter.Builder> getNumericFiltersBuilderList()

Optional. The list of numeric filters.

repeated .google.cloud.aiplatform.v1.NearestNeighborQuery.NumericFilter numeric_filters = 8 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
List<Builder>

getNumericFiltersCount()

public int getNumericFiltersCount()

Optional. The list of numeric filters.

repeated .google.cloud.aiplatform.v1.NearestNeighborQuery.NumericFilter numeric_filters = 8 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
int

getNumericFiltersList()

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

Returns
Type Description
List<NumericFilter>

getNumericFiltersOrBuilder(int index)

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

Parameter
Name Description
index int
Returns
Type Description
NearestNeighborQuery.NumericFilterOrBuilder

getNumericFiltersOrBuilderList()

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

Returns
Type Description
List<? extends com.google.cloud.aiplatform.v1.NearestNeighborQuery.NumericFilterOrBuilder>

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
Type Description
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
Type Description
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
Type Description
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
Type Description
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
Name Description
index int
Returns
Type Description
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
Name Description
index int
Returns
Type Description
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
Type Description
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
Type Description
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
Type Description
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
Name Description
index int
Returns
Type Description
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
Type Description
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
Type Description
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
Type Description
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
Type Description
boolean

Whether the parameters field is set.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
Type Description
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
Name Description
value NearestNeighborQuery.Embedding
Returns
Type Description
NearestNeighborQuery.Builder

mergeFrom(NearestNeighborQuery other)

public NearestNeighborQuery.Builder mergeFrom(NearestNeighborQuery other)
Parameter
Name Description
other NearestNeighborQuery
Returns
Type Description
NearestNeighborQuery.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public NearestNeighborQuery.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
NearestNeighborQuery.Builder
Overrides
Exceptions
Type Description
IOException

mergeFrom(Message other)

public NearestNeighborQuery.Builder mergeFrom(Message other)
Parameter
Name Description
other Message
Returns
Type Description
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
Name Description
value NearestNeighborQuery.Parameters
Returns
Type Description
NearestNeighborQuery.Builder

mergeUnknownFields(UnknownFieldSet unknownFields)

public final NearestNeighborQuery.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
NearestNeighborQuery.Builder
Overrides

removeNumericFilters(int index)

public NearestNeighborQuery.Builder removeNumericFilters(int index)

Optional. The list of numeric filters.

repeated .google.cloud.aiplatform.v1.NearestNeighborQuery.NumericFilter numeric_filters = 8 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
index int
Returns
Type Description
NearestNeighborQuery.Builder

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
Name Description
index int
Returns
Type Description
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
Name Description
value NearestNeighborQuery.Embedding
Returns
Type Description
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
Name Description
builderForValue NearestNeighborQuery.Embedding.Builder
Returns
Type Description
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
Name Description
value String

The entityId to set.

Returns
Type Description
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
Name Description
value ByteString

The bytes for entityId to set.

Returns
Type Description
NearestNeighborQuery.Builder

This builder for chaining.

setField(Descriptors.FieldDescriptor field, Object value)

public NearestNeighborQuery.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
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
Name Description
value int

The neighborCount to set.

Returns
Type Description
NearestNeighborQuery.Builder

This builder for chaining.

setNumericFilters(int index, NearestNeighborQuery.NumericFilter value)

public NearestNeighborQuery.Builder setNumericFilters(int index, NearestNeighborQuery.NumericFilter value)

Optional. The list of numeric filters.

repeated .google.cloud.aiplatform.v1.NearestNeighborQuery.NumericFilter numeric_filters = 8 [(.google.api.field_behavior) = OPTIONAL];

Parameters
Name Description
index int
value NearestNeighborQuery.NumericFilter
Returns
Type Description
NearestNeighborQuery.Builder

setNumericFilters(int index, NearestNeighborQuery.NumericFilter.Builder builderForValue)

public NearestNeighborQuery.Builder setNumericFilters(int index, NearestNeighborQuery.NumericFilter.Builder builderForValue)

Optional. The list of numeric filters.

repeated .google.cloud.aiplatform.v1.NearestNeighborQuery.NumericFilter numeric_filters = 8 [(.google.api.field_behavior) = OPTIONAL];

Parameters
Name Description
index int
builderForValue NearestNeighborQuery.NumericFilter.Builder
Returns
Type Description
NearestNeighborQuery.Builder

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
Name Description
value NearestNeighborQuery.Parameters
Returns
Type Description
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
Name Description
builderForValue NearestNeighborQuery.Parameters.Builder
Returns
Type Description
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
Name Description
value int

The perCrowdingAttributeNeighborCount to set.

Returns
Type Description
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
Name Description
field FieldDescriptor
index int
value Object
Returns
Type Description
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
Name Description
index int
value NearestNeighborQuery.StringFilter
Returns
Type Description
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
Name Description
index int
builderForValue NearestNeighborQuery.StringFilter.Builder
Returns
Type Description
NearestNeighborQuery.Builder

setUnknownFields(UnknownFieldSet unknownFields)

public final NearestNeighborQuery.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
NearestNeighborQuery.Builder
Overrides