Package com.google.cloud.firestore
Class VectorQueryOptions.Builder
java.lang.Object
com.google.cloud.firestore.VectorQueryOptions.Builder
- Enclosing class:
- VectorQueryOptions
-
Method Summary
Modifier and TypeMethodDescriptionbuild()setDistanceResultField(FieldPath fieldPath) Specifies the name of the field that will be set on each returned DocumentSnapshot, which will contain the computed distance for the document.setDistanceResultField(String fieldPath) Specifies the name of the field that will be set on each returned DocumentSnapshot, which will contain the computed distance for the document.setDistanceThreshold(Double distanceThreshold) Specifies a threshold for which no less similar documents will be returned.
-
Method Details
-
setDistanceResultField
Specifies the name of the field that will be set on each returned DocumentSnapshot, which will contain the computed distance for the document. If `null`, then the computed distance will not be returned. Default value: `null`.- Parameters:
fieldPath- A string value specifying the distance result field.
-
setDistanceResultField
Specifies the name of the field that will be set on each returned DocumentSnapshot, which will contain the computed distance for the document. If `null`, then the computed distance will not be returned. Default value: `null`.- Parameters:
fieldPath- AFieldPathvalue specifying the distance result field.
-
setDistanceThreshold
Specifies a threshold for which no less similar documents will be returned. The behavior of the specified `distanceMeasure` will affect the meaning of the distance threshold.- For `distanceMeasure: "EUCLIDEAN"`, the meaning of `distanceThreshold` is:
SELECT docs WHERE euclidean_distance <= distanceThreshold - For `distanceMeasure: "COSINE"`, the meaning of `distanceThreshold` is:
SELECT docs WHERE cosine_distance <= distanceThreshold - For `distanceMeasure: "DOT_PRODUCT"`, the meaning of `distanceThreshold` is:
SELECT docs WHERE dot_product_distance >= distanceThreshold
If `null`, then the computed distance will not be returned. Default value: `null`.
- Parameters:
distanceThreshold- A Double value specifying the distance threshold.
- For `distanceMeasure: "EUCLIDEAN"`, the meaning of `distanceThreshold` is:
-
build
-