Class FindNearest.Builder

java.lang.Object
com.google.protobuf.AbstractMessageLite.Builder
com.google.protobuf.AbstractMessage.Builder<BuilderT>
com.google.protobuf.GeneratedMessageV3.Builder<FindNearest.Builder>
com.google.datastore.v1.FindNearest.Builder
All Implemented Interfaces:
FindNearestOrBuilder, com.google.protobuf.Message.Builder, com.google.protobuf.MessageLite.Builder, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, Cloneable
Enclosing class:
FindNearest

public static final class FindNearest.Builder extends com.google.protobuf.GeneratedMessageV3.Builder<FindNearest.Builder> implements FindNearestOrBuilder
 Nearest Neighbors search config. The ordering provided by FindNearest
 supersedes the order_by stage. If multiple documents have the same vector
 distance, the returned document order is not guaranteed to be stable between
 queries.
 
Protobuf type google.datastore.v1.FindNearest
  • Method Details

    • getDescriptor

      public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
    • internalGetFieldAccessorTable

      protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
      Specified by:
      internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessageV3.Builder<FindNearest.Builder>
    • clear

      public FindNearest.Builder clear()
      Specified by:
      clear in interface com.google.protobuf.Message.Builder
      Specified by:
      clear in interface com.google.protobuf.MessageLite.Builder
      Overrides:
      clear in class com.google.protobuf.GeneratedMessageV3.Builder<FindNearest.Builder>
    • getDescriptorForType

      public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
      Specified by:
      getDescriptorForType in interface com.google.protobuf.Message.Builder
      Specified by:
      getDescriptorForType in interface com.google.protobuf.MessageOrBuilder
      Overrides:
      getDescriptorForType in class com.google.protobuf.GeneratedMessageV3.Builder<FindNearest.Builder>
    • getDefaultInstanceForType

      public FindNearest getDefaultInstanceForType()
      Specified by:
      getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuilder
      Specified by:
      getDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilder
    • build

      public FindNearest build()
      Specified by:
      build in interface com.google.protobuf.Message.Builder
      Specified by:
      build in interface com.google.protobuf.MessageLite.Builder
    • buildPartial

      public FindNearest buildPartial()
      Specified by:
      buildPartial in interface com.google.protobuf.Message.Builder
      Specified by:
      buildPartial in interface com.google.protobuf.MessageLite.Builder
    • clone

      public FindNearest.Builder clone()
      Specified by:
      clone in interface com.google.protobuf.Message.Builder
      Specified by:
      clone in interface com.google.protobuf.MessageLite.Builder
      Overrides:
      clone in class com.google.protobuf.GeneratedMessageV3.Builder<FindNearest.Builder>
    • setField

      public FindNearest.Builder setField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value)
      Specified by:
      setField in interface com.google.protobuf.Message.Builder
      Overrides:
      setField in class com.google.protobuf.GeneratedMessageV3.Builder<FindNearest.Builder>
    • clearField

      public FindNearest.Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field)
      Specified by:
      clearField in interface com.google.protobuf.Message.Builder
      Overrides:
      clearField in class com.google.protobuf.GeneratedMessageV3.Builder<FindNearest.Builder>
    • clearOneof

      public FindNearest.Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)
      Specified by:
      clearOneof in interface com.google.protobuf.Message.Builder
      Overrides:
      clearOneof in class com.google.protobuf.GeneratedMessageV3.Builder<FindNearest.Builder>
    • setRepeatedField

      public FindNearest.Builder setRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, int index, Object value)
      Specified by:
      setRepeatedField in interface com.google.protobuf.Message.Builder
      Overrides:
      setRepeatedField in class com.google.protobuf.GeneratedMessageV3.Builder<FindNearest.Builder>
    • addRepeatedField

      public FindNearest.Builder addRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value)
      Specified by:
      addRepeatedField in interface com.google.protobuf.Message.Builder
      Overrides:
      addRepeatedField in class com.google.protobuf.GeneratedMessageV3.Builder<FindNearest.Builder>
    • mergeFrom

      public FindNearest.Builder mergeFrom(com.google.protobuf.Message other)
      Specified by:
      mergeFrom in interface com.google.protobuf.Message.Builder
      Overrides:
      mergeFrom in class com.google.protobuf.AbstractMessage.Builder<FindNearest.Builder>
    • mergeFrom

      public FindNearest.Builder mergeFrom(FindNearest other)
    • isInitialized

      public final boolean isInitialized()
      Specified by:
      isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
      Overrides:
      isInitialized in class com.google.protobuf.GeneratedMessageV3.Builder<FindNearest.Builder>
    • mergeFrom

      public FindNearest.Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
      Specified by:
      mergeFrom in interface com.google.protobuf.Message.Builder
      Specified by:
      mergeFrom in interface com.google.protobuf.MessageLite.Builder
      Overrides:
      mergeFrom in class com.google.protobuf.AbstractMessage.Builder<FindNearest.Builder>
      Throws:
      IOException
    • hasVectorProperty

      public boolean hasVectorProperty()
       Required. An indexed vector property to search upon. Only documents which
       contain vectors whose dimensionality match the query_vector can be
       returned.
       
      .google.datastore.v1.PropertyReference vector_property = 1 [(.google.api.field_behavior) = REQUIRED];
      Specified by:
      hasVectorProperty in interface FindNearestOrBuilder
      Returns:
      Whether the vectorProperty field is set.
    • getVectorProperty

      public PropertyReference getVectorProperty()
       Required. An indexed vector property to search upon. Only documents which
       contain vectors whose dimensionality match the query_vector can be
       returned.
       
      .google.datastore.v1.PropertyReference vector_property = 1 [(.google.api.field_behavior) = REQUIRED];
      Specified by:
      getVectorProperty in interface FindNearestOrBuilder
      Returns:
      The vectorProperty.
    • setVectorProperty

      public FindNearest.Builder setVectorProperty(PropertyReference value)
       Required. An indexed vector property to search upon. Only documents which
       contain vectors whose dimensionality match the query_vector can be
       returned.
       
      .google.datastore.v1.PropertyReference vector_property = 1 [(.google.api.field_behavior) = REQUIRED];
    • setVectorProperty

      public FindNearest.Builder setVectorProperty(PropertyReference.Builder builderForValue)
       Required. An indexed vector property to search upon. Only documents which
       contain vectors whose dimensionality match the query_vector can be
       returned.
       
      .google.datastore.v1.PropertyReference vector_property = 1 [(.google.api.field_behavior) = REQUIRED];
    • mergeVectorProperty

      public FindNearest.Builder mergeVectorProperty(PropertyReference value)
       Required. An indexed vector property to search upon. Only documents which
       contain vectors whose dimensionality match the query_vector can be
       returned.
       
      .google.datastore.v1.PropertyReference vector_property = 1 [(.google.api.field_behavior) = REQUIRED];
    • clearVectorProperty

      public FindNearest.Builder clearVectorProperty()
       Required. An indexed vector property to search upon. Only documents which
       contain vectors whose dimensionality match the query_vector can be
       returned.
       
      .google.datastore.v1.PropertyReference vector_property = 1 [(.google.api.field_behavior) = REQUIRED];
    • getVectorPropertyBuilder

      public PropertyReference.Builder getVectorPropertyBuilder()
       Required. An indexed vector property to search upon. Only documents which
       contain vectors whose dimensionality match the query_vector can be
       returned.
       
      .google.datastore.v1.PropertyReference vector_property = 1 [(.google.api.field_behavior) = REQUIRED];
    • getVectorPropertyOrBuilder

      public PropertyReferenceOrBuilder getVectorPropertyOrBuilder()
       Required. An indexed vector property to search upon. Only documents which
       contain vectors whose dimensionality match the query_vector can be
       returned.
       
      .google.datastore.v1.PropertyReference vector_property = 1 [(.google.api.field_behavior) = REQUIRED];
      Specified by:
      getVectorPropertyOrBuilder in interface FindNearestOrBuilder
    • hasQueryVector

      public boolean hasQueryVector()
       Required. The query vector that we are searching on. Must be a vector of no
       more than 2048 dimensions.
       
      .google.datastore.v1.Value query_vector = 2 [(.google.api.field_behavior) = REQUIRED];
      Specified by:
      hasQueryVector in interface FindNearestOrBuilder
      Returns:
      Whether the queryVector field is set.
    • getQueryVector

      public Value getQueryVector()
       Required. The query vector that we are searching on. Must be a vector of no
       more than 2048 dimensions.
       
      .google.datastore.v1.Value query_vector = 2 [(.google.api.field_behavior) = REQUIRED];
      Specified by:
      getQueryVector in interface FindNearestOrBuilder
      Returns:
      The queryVector.
    • setQueryVector

      public FindNearest.Builder setQueryVector(Value value)
       Required. The query vector that we are searching on. Must be a vector of no
       more than 2048 dimensions.
       
      .google.datastore.v1.Value query_vector = 2 [(.google.api.field_behavior) = REQUIRED];
    • setQueryVector

      public FindNearest.Builder setQueryVector(Value.Builder builderForValue)
       Required. The query vector that we are searching on. Must be a vector of no
       more than 2048 dimensions.
       
      .google.datastore.v1.Value query_vector = 2 [(.google.api.field_behavior) = REQUIRED];
    • mergeQueryVector

      public FindNearest.Builder mergeQueryVector(Value value)
       Required. The query vector that we are searching on. Must be a vector of no
       more than 2048 dimensions.
       
      .google.datastore.v1.Value query_vector = 2 [(.google.api.field_behavior) = REQUIRED];
    • clearQueryVector

      public FindNearest.Builder clearQueryVector()
       Required. The query vector that we are searching on. Must be a vector of no
       more than 2048 dimensions.
       
      .google.datastore.v1.Value query_vector = 2 [(.google.api.field_behavior) = REQUIRED];
    • getQueryVectorBuilder

      public Value.Builder getQueryVectorBuilder()
       Required. The query vector that we are searching on. Must be a vector of no
       more than 2048 dimensions.
       
      .google.datastore.v1.Value query_vector = 2 [(.google.api.field_behavior) = REQUIRED];
    • getQueryVectorOrBuilder

      public ValueOrBuilder getQueryVectorOrBuilder()
       Required. The query vector that we are searching on. Must be a vector of no
       more than 2048 dimensions.
       
      .google.datastore.v1.Value query_vector = 2 [(.google.api.field_behavior) = REQUIRED];
      Specified by:
      getQueryVectorOrBuilder in interface FindNearestOrBuilder
    • getDistanceMeasureValue

      public int getDistanceMeasureValue()
       Required. The Distance Measure to use, required.
       
      .google.datastore.v1.FindNearest.DistanceMeasure distance_measure = 3 [(.google.api.field_behavior) = REQUIRED];
      Specified by:
      getDistanceMeasureValue in interface FindNearestOrBuilder
      Returns:
      The enum numeric value on the wire for distanceMeasure.
    • setDistanceMeasureValue

      public FindNearest.Builder setDistanceMeasureValue(int value)
       Required. The Distance Measure to use, required.
       
      .google.datastore.v1.FindNearest.DistanceMeasure distance_measure = 3 [(.google.api.field_behavior) = REQUIRED];
      Parameters:
      value - The enum numeric value on the wire for distanceMeasure to set.
      Returns:
      This builder for chaining.
    • getDistanceMeasure

      public FindNearest.DistanceMeasure getDistanceMeasure()
       Required. The Distance Measure to use, required.
       
      .google.datastore.v1.FindNearest.DistanceMeasure distance_measure = 3 [(.google.api.field_behavior) = REQUIRED];
      Specified by:
      getDistanceMeasure in interface FindNearestOrBuilder
      Returns:
      The distanceMeasure.
    • setDistanceMeasure

      public FindNearest.Builder setDistanceMeasure(FindNearest.DistanceMeasure value)
       Required. The Distance Measure to use, required.
       
      .google.datastore.v1.FindNearest.DistanceMeasure distance_measure = 3 [(.google.api.field_behavior) = REQUIRED];
      Parameters:
      value - The distanceMeasure to set.
      Returns:
      This builder for chaining.
    • clearDistanceMeasure

      public FindNearest.Builder clearDistanceMeasure()
       Required. The Distance Measure to use, required.
       
      .google.datastore.v1.FindNearest.DistanceMeasure distance_measure = 3 [(.google.api.field_behavior) = REQUIRED];
      Returns:
      This builder for chaining.
    • hasLimit

      public boolean hasLimit()
       Required. The number of nearest neighbors to return. Must be a positive
       integer of no more than 100.
       
      .google.protobuf.Int32Value limit = 4 [(.google.api.field_behavior) = REQUIRED];
      Specified by:
      hasLimit in interface FindNearestOrBuilder
      Returns:
      Whether the limit field is set.
    • getLimit

      public com.google.protobuf.Int32Value getLimit()
       Required. The number of nearest neighbors to return. Must be a positive
       integer of no more than 100.
       
      .google.protobuf.Int32Value limit = 4 [(.google.api.field_behavior) = REQUIRED];
      Specified by:
      getLimit in interface FindNearestOrBuilder
      Returns:
      The limit.
    • setLimit

      public FindNearest.Builder setLimit(com.google.protobuf.Int32Value value)
       Required. The number of nearest neighbors to return. Must be a positive
       integer of no more than 100.
       
      .google.protobuf.Int32Value limit = 4 [(.google.api.field_behavior) = REQUIRED];
    • setLimit

      public FindNearest.Builder setLimit(com.google.protobuf.Int32Value.Builder builderForValue)
       Required. The number of nearest neighbors to return. Must be a positive
       integer of no more than 100.
       
      .google.protobuf.Int32Value limit = 4 [(.google.api.field_behavior) = REQUIRED];
    • mergeLimit

      public FindNearest.Builder mergeLimit(com.google.protobuf.Int32Value value)
       Required. The number of nearest neighbors to return. Must be a positive
       integer of no more than 100.
       
      .google.protobuf.Int32Value limit = 4 [(.google.api.field_behavior) = REQUIRED];
    • clearLimit

      public FindNearest.Builder clearLimit()
       Required. The number of nearest neighbors to return. Must be a positive
       integer of no more than 100.
       
      .google.protobuf.Int32Value limit = 4 [(.google.api.field_behavior) = REQUIRED];
    • getLimitBuilder

      public com.google.protobuf.Int32Value.Builder getLimitBuilder()
       Required. The number of nearest neighbors to return. Must be a positive
       integer of no more than 100.
       
      .google.protobuf.Int32Value limit = 4 [(.google.api.field_behavior) = REQUIRED];
    • getLimitOrBuilder

      public com.google.protobuf.Int32ValueOrBuilder getLimitOrBuilder()
       Required. The number of nearest neighbors to return. Must be a positive
       integer of no more than 100.
       
      .google.protobuf.Int32Value limit = 4 [(.google.api.field_behavior) = REQUIRED];
      Specified by:
      getLimitOrBuilder in interface FindNearestOrBuilder
    • getDistanceResultProperty

      public String getDistanceResultProperty()
       Optional. Optional name of the field to output the result of the vector
       distance calculation. Must conform to [entity
       property][google.datastore.v1.Entity.properties] limitations.
       
      string distance_result_property = 5 [(.google.api.field_behavior) = OPTIONAL];
      Specified by:
      getDistanceResultProperty in interface FindNearestOrBuilder
      Returns:
      The distanceResultProperty.
    • getDistanceResultPropertyBytes

      public com.google.protobuf.ByteString getDistanceResultPropertyBytes()
       Optional. Optional name of the field to output the result of the vector
       distance calculation. Must conform to [entity
       property][google.datastore.v1.Entity.properties] limitations.
       
      string distance_result_property = 5 [(.google.api.field_behavior) = OPTIONAL];
      Specified by:
      getDistanceResultPropertyBytes in interface FindNearestOrBuilder
      Returns:
      The bytes for distanceResultProperty.
    • setDistanceResultProperty

      public FindNearest.Builder setDistanceResultProperty(String value)
       Optional. Optional name of the field to output the result of the vector
       distance calculation. Must conform to [entity
       property][google.datastore.v1.Entity.properties] limitations.
       
      string distance_result_property = 5 [(.google.api.field_behavior) = OPTIONAL];
      Parameters:
      value - The distanceResultProperty to set.
      Returns:
      This builder for chaining.
    • clearDistanceResultProperty

      public FindNearest.Builder clearDistanceResultProperty()
       Optional. Optional name of the field to output the result of the vector
       distance calculation. Must conform to [entity
       property][google.datastore.v1.Entity.properties] limitations.
       
      string distance_result_property = 5 [(.google.api.field_behavior) = OPTIONAL];
      Returns:
      This builder for chaining.
    • setDistanceResultPropertyBytes

      public FindNearest.Builder setDistanceResultPropertyBytes(com.google.protobuf.ByteString value)
       Optional. Optional name of the field to output the result of the vector
       distance calculation. Must conform to [entity
       property][google.datastore.v1.Entity.properties] limitations.
       
      string distance_result_property = 5 [(.google.api.field_behavior) = OPTIONAL];
      Parameters:
      value - The bytes for distanceResultProperty to set.
      Returns:
      This builder for chaining.
    • hasDistanceThreshold

      public boolean hasDistanceThreshold()
       Optional. Option to specify a threshold for which no less similar documents
       will be returned. The behavior of the specified `distance_measure` will
       affect the meaning of the distance threshold. Since DOT_PRODUCT distances
       increase when the vectors are more similar, the comparison is inverted.
      
       For EUCLIDEAN, COSINE: WHERE distance <= distance_threshold
       For DOT_PRODUCT:       WHERE distance >= distance_threshold
       
      .google.protobuf.DoubleValue distance_threshold = 6 [(.google.api.field_behavior) = OPTIONAL];
      Specified by:
      hasDistanceThreshold in interface FindNearestOrBuilder
      Returns:
      Whether the distanceThreshold field is set.
    • getDistanceThreshold

      public com.google.protobuf.DoubleValue getDistanceThreshold()
       Optional. Option to specify a threshold for which no less similar documents
       will be returned. The behavior of the specified `distance_measure` will
       affect the meaning of the distance threshold. Since DOT_PRODUCT distances
       increase when the vectors are more similar, the comparison is inverted.
      
       For EUCLIDEAN, COSINE: WHERE distance <= distance_threshold
       For DOT_PRODUCT:       WHERE distance >= distance_threshold
       
      .google.protobuf.DoubleValue distance_threshold = 6 [(.google.api.field_behavior) = OPTIONAL];
      Specified by:
      getDistanceThreshold in interface FindNearestOrBuilder
      Returns:
      The distanceThreshold.
    • setDistanceThreshold

      public FindNearest.Builder setDistanceThreshold(com.google.protobuf.DoubleValue value)
       Optional. Option to specify a threshold for which no less similar documents
       will be returned. The behavior of the specified `distance_measure` will
       affect the meaning of the distance threshold. Since DOT_PRODUCT distances
       increase when the vectors are more similar, the comparison is inverted.
      
       For EUCLIDEAN, COSINE: WHERE distance <= distance_threshold
       For DOT_PRODUCT:       WHERE distance >= distance_threshold
       
      .google.protobuf.DoubleValue distance_threshold = 6 [(.google.api.field_behavior) = OPTIONAL];
    • setDistanceThreshold

      public FindNearest.Builder setDistanceThreshold(com.google.protobuf.DoubleValue.Builder builderForValue)
       Optional. Option to specify a threshold for which no less similar documents
       will be returned. The behavior of the specified `distance_measure` will
       affect the meaning of the distance threshold. Since DOT_PRODUCT distances
       increase when the vectors are more similar, the comparison is inverted.
      
       For EUCLIDEAN, COSINE: WHERE distance <= distance_threshold
       For DOT_PRODUCT:       WHERE distance >= distance_threshold
       
      .google.protobuf.DoubleValue distance_threshold = 6 [(.google.api.field_behavior) = OPTIONAL];
    • mergeDistanceThreshold

      public FindNearest.Builder mergeDistanceThreshold(com.google.protobuf.DoubleValue value)
       Optional. Option to specify a threshold for which no less similar documents
       will be returned. The behavior of the specified `distance_measure` will
       affect the meaning of the distance threshold. Since DOT_PRODUCT distances
       increase when the vectors are more similar, the comparison is inverted.
      
       For EUCLIDEAN, COSINE: WHERE distance <= distance_threshold
       For DOT_PRODUCT:       WHERE distance >= distance_threshold
       
      .google.protobuf.DoubleValue distance_threshold = 6 [(.google.api.field_behavior) = OPTIONAL];
    • clearDistanceThreshold

      public FindNearest.Builder clearDistanceThreshold()
       Optional. Option to specify a threshold for which no less similar documents
       will be returned. The behavior of the specified `distance_measure` will
       affect the meaning of the distance threshold. Since DOT_PRODUCT distances
       increase when the vectors are more similar, the comparison is inverted.
      
       For EUCLIDEAN, COSINE: WHERE distance <= distance_threshold
       For DOT_PRODUCT:       WHERE distance >= distance_threshold
       
      .google.protobuf.DoubleValue distance_threshold = 6 [(.google.api.field_behavior) = OPTIONAL];
    • getDistanceThresholdBuilder

      public com.google.protobuf.DoubleValue.Builder getDistanceThresholdBuilder()
       Optional. Option to specify a threshold for which no less similar documents
       will be returned. The behavior of the specified `distance_measure` will
       affect the meaning of the distance threshold. Since DOT_PRODUCT distances
       increase when the vectors are more similar, the comparison is inverted.
      
       For EUCLIDEAN, COSINE: WHERE distance <= distance_threshold
       For DOT_PRODUCT:       WHERE distance >= distance_threshold
       
      .google.protobuf.DoubleValue distance_threshold = 6 [(.google.api.field_behavior) = OPTIONAL];
    • getDistanceThresholdOrBuilder

      public com.google.protobuf.DoubleValueOrBuilder getDistanceThresholdOrBuilder()
       Optional. Option to specify a threshold for which no less similar documents
       will be returned. The behavior of the specified `distance_measure` will
       affect the meaning of the distance threshold. Since DOT_PRODUCT distances
       increase when the vectors are more similar, the comparison is inverted.
      
       For EUCLIDEAN, COSINE: WHERE distance <= distance_threshold
       For DOT_PRODUCT:       WHERE distance >= distance_threshold
       
      .google.protobuf.DoubleValue distance_threshold = 6 [(.google.api.field_behavior) = OPTIONAL];
      Specified by:
      getDistanceThresholdOrBuilder in interface FindNearestOrBuilder
    • setUnknownFields

      public final FindNearest.Builder setUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)
      Specified by:
      setUnknownFields in interface com.google.protobuf.Message.Builder
      Overrides:
      setUnknownFields in class com.google.protobuf.GeneratedMessageV3.Builder<FindNearest.Builder>
    • mergeUnknownFields

      public final FindNearest.Builder mergeUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)
      Specified by:
      mergeUnknownFields in interface com.google.protobuf.Message.Builder
      Overrides:
      mergeUnknownFields in class com.google.protobuf.GeneratedMessageV3.Builder<FindNearest.Builder>