Package com.google.firestore.v1
Class StructuredQuery.FindNearest
java.lang.Object
com.google.protobuf.AbstractMessageLite
com.google.protobuf.AbstractMessage
com.google.protobuf.GeneratedMessageV3
com.google.firestore.v1.StructuredQuery.FindNearest
- All Implemented Interfaces:
StructuredQuery.FindNearestOrBuilder,com.google.protobuf.Message,com.google.protobuf.MessageLite,com.google.protobuf.MessageLiteOrBuilder,com.google.protobuf.MessageOrBuilder,Serializable
- Enclosing class:
- StructuredQuery
public static final class StructuredQuery.FindNearest
extends com.google.protobuf.GeneratedMessageV3
implements StructuredQuery.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.firestore.v1.StructuredQuery.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 StructuredQuery.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<StructuredQuery.FindNearest>Required.Required.intRequired.Required.booleanOptional.inthashCode()booleanhasLimit()Required.booleanRequired.booleanRequired.protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTablefinal booleannewBuilder(StructuredQuery.FindNearest prototype) protected StructuredQuery.FindNearest.BuildernewBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) protected ObjectnewInstance(com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter unused) static StructuredQuery.FindNearestparseDelimitedFrom(InputStream input) static StructuredQuery.FindNearestparseDelimitedFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static StructuredQuery.FindNearestparseFrom(byte[] data) static StructuredQuery.FindNearestparseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static StructuredQuery.FindNearestparseFrom(com.google.protobuf.ByteString data) static StructuredQuery.FindNearestparseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static StructuredQuery.FindNearestparseFrom(com.google.protobuf.CodedInputStream input) static StructuredQuery.FindNearestparseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static StructuredQuery.FindNearestparseFrom(InputStream input) static StructuredQuery.FindNearestparseFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static StructuredQuery.FindNearestparseFrom(ByteBuffer data) static StructuredQuery.FindNearestparseFrom(ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static com.google.protobuf.Parser<StructuredQuery.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_FIELD_FIELD_NUMBER
public static final int VECTOR_FIELD_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_FIELD_FIELD_NUMBER
public static final int DISTANCE_RESULT_FIELD_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
-
hasVectorField
public boolean hasVectorField()Required. An indexed vector field to search upon. Only documents which contain vectors whose dimensionality match the query_vector can be returned.
.google.firestore.v1.StructuredQuery.FieldReference vector_field = 1 [(.google.api.field_behavior) = REQUIRED];- Specified by:
hasVectorFieldin interfaceStructuredQuery.FindNearestOrBuilder- Returns:
- Whether the vectorField field is set.
-
getVectorField
Required. An indexed vector field to search upon. Only documents which contain vectors whose dimensionality match the query_vector can be returned.
.google.firestore.v1.StructuredQuery.FieldReference vector_field = 1 [(.google.api.field_behavior) = REQUIRED];- Specified by:
getVectorFieldin interfaceStructuredQuery.FindNearestOrBuilder- Returns:
- The vectorField.
-
getVectorFieldOrBuilder
Required. An indexed vector field to search upon. Only documents which contain vectors whose dimensionality match the query_vector can be returned.
.google.firestore.v1.StructuredQuery.FieldReference vector_field = 1 [(.google.api.field_behavior) = REQUIRED];- Specified by:
getVectorFieldOrBuilderin interfaceStructuredQuery.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.firestore.v1.Value query_vector = 2 [(.google.api.field_behavior) = REQUIRED];- Specified by:
hasQueryVectorin interfaceStructuredQuery.FindNearestOrBuilder- 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.firestore.v1.Value query_vector = 2 [(.google.api.field_behavior) = REQUIRED];- Specified by:
getQueryVectorin interfaceStructuredQuery.FindNearestOrBuilder- Returns:
- The queryVector.
-
getQueryVectorOrBuilder
Required. The query vector that we are searching on. Must be a vector of no more than 2048 dimensions.
.google.firestore.v1.Value query_vector = 2 [(.google.api.field_behavior) = REQUIRED];- Specified by:
getQueryVectorOrBuilderin interfaceStructuredQuery.FindNearestOrBuilder
-
getDistanceMeasureValue
public int getDistanceMeasureValue()Required. The distance measure to use, required.
.google.firestore.v1.StructuredQuery.FindNearest.DistanceMeasure distance_measure = 3 [(.google.api.field_behavior) = REQUIRED];- Specified by:
getDistanceMeasureValuein interfaceStructuredQuery.FindNearestOrBuilder- Returns:
- The enum numeric value on the wire for distanceMeasure.
-
getDistanceMeasure
Required. The distance measure to use, required.
.google.firestore.v1.StructuredQuery.FindNearest.DistanceMeasure distance_measure = 3 [(.google.api.field_behavior) = REQUIRED];- Specified by:
getDistanceMeasurein interfaceStructuredQuery.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 1000.
.google.protobuf.Int32Value limit = 4 [(.google.api.field_behavior) = REQUIRED];- Specified by:
hasLimitin interfaceStructuredQuery.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 1000.
.google.protobuf.Int32Value limit = 4 [(.google.api.field_behavior) = REQUIRED];- Specified by:
getLimitin interfaceStructuredQuery.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 1000.
.google.protobuf.Int32Value limit = 4 [(.google.api.field_behavior) = REQUIRED];- Specified by:
getLimitOrBuilderin interfaceStructuredQuery.FindNearestOrBuilder
-
getDistanceResultField
Optional. Optional name of the field to output the result of the vector distance calculation. Must conform to [document field name][google.firestore.v1.Document.fields] limitations.
string distance_result_field = 5 [(.google.api.field_behavior) = OPTIONAL];- Specified by:
getDistanceResultFieldin interfaceStructuredQuery.FindNearestOrBuilder- Returns:
- The distanceResultField.
-
getDistanceResultFieldBytes
public com.google.protobuf.ByteString getDistanceResultFieldBytes()Optional. Optional name of the field to output the result of the vector distance calculation. Must conform to [document field name][google.firestore.v1.Document.fields] limitations.
string distance_result_field = 5 [(.google.api.field_behavior) = OPTIONAL];- Specified by:
getDistanceResultFieldBytesin interfaceStructuredQuery.FindNearestOrBuilder- Returns:
- The bytes for distanceResultField.
-
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 interfaceStructuredQuery.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:
getDistanceThresholdin interfaceStructuredQuery.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:
getDistanceThresholdOrBuilderin interfaceStructuredQuery.FindNearestOrBuilder
-
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 StructuredQuery.FindNearest parseFrom(ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException - Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static StructuredQuery.FindNearest parseFrom(ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException - Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static StructuredQuery.FindNearest parseFrom(com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException - Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static StructuredQuery.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 StructuredQuery.FindNearest parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException - Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static StructuredQuery.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 StructuredQuery.FindNearest parseFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException - Throws:
IOException
-
parseDelimitedFrom
- Throws:
IOException
-
parseDelimitedFrom
public static StructuredQuery.FindNearest parseDelimitedFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException - Throws:
IOException
-
parseFrom
public static StructuredQuery.FindNearest parseFrom(com.google.protobuf.CodedInputStream input) throws IOException - Throws:
IOException
-
parseFrom
public static StructuredQuery.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 StructuredQuery.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
-