Class FindNearest

java.lang.Object
com.google.protobuf.AbstractMessageLite
com.google.protobuf.AbstractMessage
com.google.protobuf.GeneratedMessageV3
com.google.datastore.v1.FindNearest
All Implemented Interfaces:
FindNearestOrBuilder, com.google.protobuf.Message, com.google.protobuf.MessageLite, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, Serializable

public final class FindNearest extends com.google.protobuf.GeneratedMessageV3 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
See Also:
  • Field Details

    • VECTOR_PROPERTY_FIELD_NUMBER

      public static final int VECTOR_PROPERTY_FIELD_NUMBER
      See Also:
    • QUERY_VECTOR_FIELD_NUMBER

      public static final int QUERY_VECTOR_FIELD_NUMBER
      See Also:
    • DISTANCE_MEASURE_FIELD_NUMBER

      public static final int DISTANCE_MEASURE_FIELD_NUMBER
      See Also:
    • LIMIT_FIELD_NUMBER

      public static final int LIMIT_FIELD_NUMBER
      See Also:
    • DISTANCE_RESULT_PROPERTY_FIELD_NUMBER

      public static final int DISTANCE_RESULT_PROPERTY_FIELD_NUMBER
      See Also:
    • DISTANCE_THRESHOLD_FIELD_NUMBER

      public static final int DISTANCE_THRESHOLD_FIELD_NUMBER
      See Also:
  • Method Details

    • newInstance

      protected Object newInstance(com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter unused)
      Overrides:
      newInstance in class com.google.protobuf.GeneratedMessageV3
    • 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
    • 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.
    • 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.
    • 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.
    • 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.
    • 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.
    • 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.
    • 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.
    • 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
    • isInitialized

      public final boolean isInitialized()
      Specified by:
      isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
      Overrides:
      isInitialized in class com.google.protobuf.GeneratedMessageV3
    • writeTo

      public void writeTo(com.google.protobuf.CodedOutputStream output) throws IOException
      Specified by:
      writeTo in interface com.google.protobuf.MessageLite
      Overrides:
      writeTo in class com.google.protobuf.GeneratedMessageV3
      Throws:
      IOException
    • getSerializedSize

      public int getSerializedSize()
      Specified by:
      getSerializedSize in interface com.google.protobuf.MessageLite
      Overrides:
      getSerializedSize in class com.google.protobuf.GeneratedMessageV3
    • equals

      public boolean equals(Object obj)
      Specified by:
      equals in interface com.google.protobuf.Message
      Overrides:
      equals in class com.google.protobuf.AbstractMessage
    • hashCode

      public int hashCode()
      Specified by:
      hashCode in interface com.google.protobuf.Message
      Overrides:
      hashCode in class com.google.protobuf.AbstractMessage
    • parseFrom

      public static FindNearest parseFrom(ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

      public static FindNearest parseFrom(ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

      public static FindNearest parseFrom(com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

      public static FindNearest parseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

      public static FindNearest parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

      public static FindNearest parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

      public static FindNearest parseFrom(InputStream input) throws IOException
      Throws:
      IOException
    • parseFrom

      public static FindNearest parseFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
      Throws:
      IOException
    • parseDelimitedFrom

      public static FindNearest parseDelimitedFrom(InputStream input) throws IOException
      Throws:
      IOException
    • parseDelimitedFrom

      public static FindNearest parseDelimitedFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
      Throws:
      IOException
    • parseFrom

      public static FindNearest parseFrom(com.google.protobuf.CodedInputStream input) throws IOException
      Throws:
      IOException
    • parseFrom

      public static FindNearest parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
      Throws:
      IOException
    • newBuilderForType

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

      public static FindNearest.Builder newBuilder()
    • newBuilder

      public static FindNearest.Builder newBuilder(FindNearest prototype)
    • toBuilder

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

      protected FindNearest.Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)
      Specified by:
      newBuilderForType in class com.google.protobuf.GeneratedMessageV3
    • getDefaultInstance

      public static FindNearest getDefaultInstance()
    • parser

      public static com.google.protobuf.Parser<FindNearest> parser()
    • getParserForType

      public com.google.protobuf.Parser<FindNearest> getParserForType()
      Specified by:
      getParserForType in interface com.google.protobuf.Message
      Specified by:
      getParserForType in interface com.google.protobuf.MessageLite
      Overrides:
      getParserForType in class com.google.protobuf.GeneratedMessageV3
    • getDefaultInstanceForType

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