public sealed class StructuredQuery.Types.FindNearest : IMessage<StructuredQuery.Types.FindNearest>, IEquatable<StructuredQuery.Types.FindNearest>, IDeepCloneable<StructuredQuery.Types.FindNearest>, IBufferMessage, IMessage
Reference documentation and code samples for the Firestore v1 API class StructuredQuery.Types.FindNearest.
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.
Implements
IMessageStructuredQueryTypesFindNearest, IEquatableStructuredQueryTypesFindNearest, IDeepCloneableStructuredQueryTypesFindNearest, IBufferMessage, IMessageNamespace
Google.Cloud.Firestore.V1Assembly
Google.Cloud.Firestore.V1.dll
Constructors
FindNearest()
public FindNearest()
FindNearest(FindNearest)
public FindNearest(StructuredQuery.Types.FindNearest other)
Parameter | |
---|---|
Name | Description |
other |
StructuredQueryTypesFindNearest |
Properties
DistanceMeasure
public StructuredQuery.Types.FindNearest.Types.DistanceMeasure DistanceMeasure { get; set; }
Required. The distance measure to use, required.
Property Value | |
---|---|
Type | Description |
StructuredQueryTypesFindNearestTypesDistanceMeasure |
DistanceResultField
public string DistanceResultField { get; set; }
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.
Property Value | |
---|---|
Type | Description |
string |
DistanceThreshold
public double? DistanceThreshold { get; set; }
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
Property Value | |
---|---|
Type | Description |
double |
Limit
public int? Limit { get; set; }
Required. The number of nearest neighbors to return. Must be a positive integer of no more than 1000.
Property Value | |
---|---|
Type | Description |
int |
QueryVector
public Value QueryVector { get; set; }
Required. The query vector that we are searching on. Must be a vector of no more than 2048 dimensions.
Property Value | |
---|---|
Type | Description |
Value |
VectorField
public StructuredQuery.Types.FieldReference VectorField { get; set; }
Required. An indexed vector field to search upon. Only documents which contain vectors whose dimensionality match the query_vector can be returned.
Property Value | |
---|---|
Type | Description |
StructuredQueryTypesFieldReference |