public final class FindNearest extends 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
Inherited Members
com.google.protobuf.GeneratedMessageV3.<ListT>makeMutableCopy(ListT)
com.google.protobuf.GeneratedMessageV3.<ListT>makeMutableCopy(ListT,int)
com.google.protobuf.GeneratedMessageV3.<T>emptyList(java.lang.Class<T>)
com.google.protobuf.GeneratedMessageV3.internalGetMapFieldReflection(int)
Static Fields
DISTANCE_MEASURE_FIELD_NUMBER
public static final int DISTANCE_MEASURE_FIELD_NUMBER
Field Value |
Type |
Description |
int |
|
DISTANCE_RESULT_PROPERTY_FIELD_NUMBER
public static final int DISTANCE_RESULT_PROPERTY_FIELD_NUMBER
Field Value |
Type |
Description |
int |
|
DISTANCE_THRESHOLD_FIELD_NUMBER
public static final int DISTANCE_THRESHOLD_FIELD_NUMBER
Field Value |
Type |
Description |
int |
|
LIMIT_FIELD_NUMBER
public static final int LIMIT_FIELD_NUMBER
Field Value |
Type |
Description |
int |
|
QUERY_VECTOR_FIELD_NUMBER
public static final int QUERY_VECTOR_FIELD_NUMBER
Field Value |
Type |
Description |
int |
|
VECTOR_PROPERTY_FIELD_NUMBER
public static final int VECTOR_PROPERTY_FIELD_NUMBER
Field Value |
Type |
Description |
int |
|
Static Methods
getDefaultInstance()
public static FindNearest getDefaultInstance()
getDescriptor()
public static final Descriptors.Descriptor getDescriptor()
newBuilder()
public static FindNearest.Builder newBuilder()
newBuilder(FindNearest prototype)
public static FindNearest.Builder newBuilder(FindNearest prototype)
public static FindNearest parseDelimitedFrom(InputStream input)
public static FindNearest parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
parseFrom(byte[] data)
public static FindNearest parseFrom(byte[] data)
Parameter |
Name |
Description |
data |
byte[]
|
parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
public static FindNearest parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
parseFrom(ByteString data)
public static FindNearest parseFrom(ByteString data)
parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
public static FindNearest parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
public static FindNearest parseFrom(CodedInputStream input)
public static FindNearest parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
public static FindNearest parseFrom(InputStream input)
public static FindNearest parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
parseFrom(ByteBuffer data)
public static FindNearest parseFrom(ByteBuffer data)
parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
public static FindNearest parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
parser()
public static Parser<FindNearest> parser()
Methods
equals(Object obj)
public boolean equals(Object obj)
Parameter |
Name |
Description |
obj |
Object
|
Overrides
getDefaultInstanceForType()
public FindNearest getDefaultInstanceForType()
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];
getDistanceMeasureValue()
public int getDistanceMeasureValue()
Required. The Distance Measure to use, required.
.google.datastore.v1.FindNearest.DistanceMeasure distance_measure = 3 [(.google.api.field_behavior) = REQUIRED];
Returns |
Type |
Description |
int |
The enum numeric value on the wire for distanceMeasure.
|
getDistanceResultProperty()
public String getDistanceResultProperty()
Optional. Optional name of the field to output the result of the vector
distance calculation. Must conform to entity
property limitations.
string distance_result_property = 5 [(.google.api.field_behavior) = OPTIONAL];
Returns |
Type |
Description |
String |
The distanceResultProperty.
|
getDistanceResultPropertyBytes()
public ByteString getDistanceResultPropertyBytes()
Optional. Optional name of the field to output the result of the vector
distance calculation. Must conform to entity
property limitations.
string distance_result_property = 5 [(.google.api.field_behavior) = OPTIONAL];
Returns |
Type |
Description |
ByteString |
The bytes for distanceResultProperty.
|
getDistanceThreshold()
public 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];
Returns |
Type |
Description |
DoubleValue |
The distanceThreshold.
|
getDistanceThresholdOrBuilder()
public 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];
getLimit()
public 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];
getLimitOrBuilder()
public 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];
getParserForType()
public Parser<FindNearest> getParserForType()
Overrides
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];
Returns |
Type |
Description |
Value |
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];
getSerializedSize()
public int getSerializedSize()
Returns |
Type |
Description |
int |
|
Overrides
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];
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];
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];
Returns |
Type |
Description |
boolean |
Whether the distanceThreshold field is set.
|
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];
Returns |
Type |
Description |
boolean |
Whether the limit field is set.
|
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];
Returns |
Type |
Description |
boolean |
Whether the queryVector field is set.
|
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];
Returns |
Type |
Description |
boolean |
Whether the vectorProperty field is set.
|
hashCode()
Returns |
Type |
Description |
int |
|
Overrides
internalGetFieldAccessorTable()
protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Overrides
isInitialized()
public final boolean isInitialized()
Overrides
newBuilderForType()
public FindNearest.Builder newBuilderForType()
newBuilderForType(GeneratedMessageV3.BuilderParent parent)
protected FindNearest.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Overrides
newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Returns |
Type |
Description |
Object |
|
Overrides
toBuilder()
public FindNearest.Builder toBuilder()
writeTo(CodedOutputStream output)
public void writeTo(CodedOutputStream output)
Overrides