Skip to content

Commit 28685f7

Browse files
Google APIscopybara-github
authored andcommitted
feat: Expose the FindNearest.distance_result_field parameter
feat: Expose the `FindNearest.distance_threshold` parameter PiperOrigin-RevId: 660557033
1 parent 37b76d3 commit 28685f7

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

google/firestore/v1/query.proto

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,22 @@ message StructuredQuery {
312312
// integer of no more than 1000.
313313
google.protobuf.Int32Value limit = 4
314314
[(google.api.field_behavior) = REQUIRED];
315+
316+
// Optional. Optional name of the field to output the result of the vector
317+
// distance calculation. Must conform to [document field
318+
// name][google.firestore.v1.Document.fields] limitations.
319+
string distance_result_field = 5 [(google.api.field_behavior) = OPTIONAL];
320+
321+
// Optional. Option to specify a threshold for which no less similar
322+
// documents will be returned. The behavior of the specified
323+
// `distance_measure` will affect the meaning of the distance threshold.
324+
// Since DOT_PRODUCT distances increase when the vectors are more similar,
325+
// the comparison is inverted.
326+
//
327+
// For EUCLIDEAN, COSINE: WHERE distance <= distance_threshold
328+
// For DOT_PRODUCT: WHERE distance >= distance_threshold
329+
google.protobuf.DoubleValue distance_threshold = 6
330+
[(google.api.field_behavior) = OPTIONAL];
315331
}
316332

317333
// Optional sub-set of the fields to return.

0 commit comments

Comments
 (0)