Package com.google.datastore.v1
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:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classNearest Neighbors search config.static enumThe distance measure to use when comparing vectors.Nested classes/interfaces inherited from class com.google.protobuf.GeneratedMessageV3
com.google.protobuf.GeneratedMessageV3.BuilderParent, com.google.protobuf.GeneratedMessageV3.ExtendableBuilder<MessageT extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage<MessageT>,BuilderT extends com.google.protobuf.GeneratedMessageV3.ExtendableBuilder<MessageT, BuilderT>>, com.google.protobuf.GeneratedMessageV3.ExtendableMessage<MessageT extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage<MessageT>>, com.google.protobuf.GeneratedMessageV3.ExtendableMessageOrBuilder<MessageT extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage<MessageT>>, com.google.protobuf.GeneratedMessageV3.FieldAccessorTable, com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter Nested classes/interfaces inherited from class com.google.protobuf.AbstractMessageLite
com.google.protobuf.AbstractMessageLite.InternalOneOfEnum -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intFields inherited from class com.google.protobuf.GeneratedMessageV3
alwaysUseFieldBuilders, unknownFieldsFields inherited from class com.google.protobuf.AbstractMessage
memoizedSizeFields inherited from class com.google.protobuf.AbstractMessageLite
memoizedHashCode -
Method Summary
Modifier and TypeMethodDescriptionbooleanstatic FindNeareststatic final com.google.protobuf.Descriptors.DescriptorRequired.intRequired.Optional.com.google.protobuf.ByteStringOptional.com.google.protobuf.DoubleValueOptional.com.google.protobuf.DoubleValueOrBuilderOptional.com.google.protobuf.Int32ValuegetLimit()Required.com.google.protobuf.Int32ValueOrBuilderRequired.com.google.protobuf.Parser<FindNearest>Required.Required.intRequired.Required.booleanOptional.inthashCode()booleanhasLimit()Required.booleanRequired.booleanRequired.protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTablefinal booleanstatic FindNearest.Builderstatic FindNearest.BuildernewBuilder(FindNearest prototype) protected FindNearest.BuildernewBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) protected ObjectnewInstance(com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter unused) static FindNearestparseDelimitedFrom(InputStream input) static FindNearestparseDelimitedFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static FindNearestparseFrom(byte[] data) static FindNearestparseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static FindNearestparseFrom(com.google.protobuf.ByteString data) static FindNearestparseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static FindNearestparseFrom(com.google.protobuf.CodedInputStream input) static FindNearestparseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static FindNearestparseFrom(InputStream input) static FindNearestparseFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static FindNearestparseFrom(ByteBuffer data) static FindNearestparseFrom(ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static com.google.protobuf.Parser<FindNearest>parser()voidwriteTo(com.google.protobuf.CodedOutputStream output) Methods inherited from class com.google.protobuf.GeneratedMessageV3
canUseUnsafe, computeStringSize, computeStringSizeNoTag, emptyBooleanList, emptyDoubleList, emptyFloatList, emptyIntList, emptyList, emptyLongList, getAllFields, getDescriptorForType, getField, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof, internalGetMapField, internalGetMapFieldReflection, isStringEmpty, makeExtensionsImmutable, makeMutableCopy, makeMutableCopy, mergeFromAndMakeImmutableInternal, mutableCopy, mutableCopy, mutableCopy, mutableCopy, mutableCopy, newBooleanList, newBuilderForType, newDoubleList, newFloatList, newIntList, newLongList, parseDelimitedWithIOException, parseDelimitedWithIOException, parseUnknownField, parseUnknownFieldProto3, parseWithIOException, parseWithIOException, parseWithIOException, parseWithIOException, serializeBooleanMapTo, serializeIntegerMapTo, serializeLongMapTo, serializeStringMapTo, writeReplace, writeString, writeStringNoTagMethods inherited from class com.google.protobuf.AbstractMessage
findInitializationErrors, getInitializationErrorString, hashBoolean, hashEnum, hashEnumList, hashFields, hashLong, toStringMethods inherited from class com.google.protobuf.AbstractMessageLite
addAll, addAll, checkByteStringIsUtf8, toByteArray, toByteString, writeDelimitedTo, writeToMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.google.protobuf.MessageLite
toByteArray, toByteString, writeDelimitedTo, writeToMethods inherited from interface com.google.protobuf.MessageOrBuilder
findInitializationErrors, getAllFields, getDescriptorForType, getField, getInitializationErrorString, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof
-
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
- Overrides:
newInstancein classcom.google.protobuf.GeneratedMessageV3
-
getDescriptor
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() -
internalGetFieldAccessorTable
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()- Specified by:
internalGetFieldAccessorTablein classcom.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:
hasVectorPropertyin interfaceFindNearestOrBuilder- Returns:
- Whether the vectorProperty field is set.
-
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:
getVectorPropertyin interfaceFindNearestOrBuilder- Returns:
- The vectorProperty.
-
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:
getVectorPropertyOrBuilderin interfaceFindNearestOrBuilder
-
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:
hasQueryVectorin interfaceFindNearestOrBuilder- Returns:
- Whether the queryVector field is set.
-
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:
getQueryVectorin interfaceFindNearestOrBuilder- Returns:
- The queryVector.
-
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:
getQueryVectorOrBuilderin interfaceFindNearestOrBuilder
-
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:
getDistanceMeasureValuein interfaceFindNearestOrBuilder- Returns:
- The enum numeric value on the wire for distanceMeasure.
-
getDistanceMeasure
Required. The Distance Measure to use, required.
.google.datastore.v1.FindNearest.DistanceMeasure distance_measure = 3 [(.google.api.field_behavior) = REQUIRED];- Specified by:
getDistanceMeasurein interfaceFindNearestOrBuilder- 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:
hasLimitin interfaceFindNearestOrBuilder- 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:
getLimitin interfaceFindNearestOrBuilder- 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:
getLimitOrBuilderin interfaceFindNearestOrBuilder
-
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:
getDistanceResultPropertyin interfaceFindNearestOrBuilder- 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:
getDistanceResultPropertyBytesin interfaceFindNearestOrBuilder- 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:
hasDistanceThresholdin interfaceFindNearestOrBuilder- 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:
getDistanceThresholdin interfaceFindNearestOrBuilder- 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:
getDistanceThresholdOrBuilderin interfaceFindNearestOrBuilder
-
isInitialized
public final boolean isInitialized()- Specified by:
isInitializedin interfacecom.google.protobuf.MessageLiteOrBuilder- Overrides:
isInitializedin classcom.google.protobuf.GeneratedMessageV3
-
writeTo
- Specified by:
writeToin interfacecom.google.protobuf.MessageLite- Overrides:
writeToin classcom.google.protobuf.GeneratedMessageV3- Throws:
IOException
-
getSerializedSize
public int getSerializedSize()- Specified by:
getSerializedSizein interfacecom.google.protobuf.MessageLite- Overrides:
getSerializedSizein classcom.google.protobuf.GeneratedMessageV3
-
equals
- Specified by:
equalsin interfacecom.google.protobuf.Message- Overrides:
equalsin classcom.google.protobuf.AbstractMessage
-
hashCode
public int hashCode()- Specified by:
hashCodein interfacecom.google.protobuf.Message- Overrides:
hashCodein classcom.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
- Throws:
IOException
-
parseFrom
public static FindNearest parseFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException - Throws:
IOException
-
parseDelimitedFrom
- Throws:
IOException
-
parseDelimitedFrom
public static FindNearest parseDelimitedFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException - Throws:
IOException
-
parseFrom
- Throws:
IOException
-
parseFrom
public static FindNearest parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException - Throws:
IOException
-
newBuilderForType
- Specified by:
newBuilderForTypein interfacecom.google.protobuf.Message- Specified by:
newBuilderForTypein interfacecom.google.protobuf.MessageLite
-
newBuilder
-
newBuilder
-
toBuilder
- Specified by:
toBuilderin interfacecom.google.protobuf.Message- Specified by:
toBuilderin interfacecom.google.protobuf.MessageLite
-
newBuilderForType
protected FindNearest.Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) - Specified by:
newBuilderForTypein classcom.google.protobuf.GeneratedMessageV3
-
getDefaultInstance
-
parser
-
getParserForType
- Specified by:
getParserForTypein interfacecom.google.protobuf.Message- Specified by:
getParserForTypein interfacecom.google.protobuf.MessageLite- Overrides:
getParserForTypein classcom.google.protobuf.GeneratedMessageV3
-
getDefaultInstanceForType
- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageLiteOrBuilder- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageOrBuilder
-