diff --git a/Firestore/metadata/V1/Query.php b/Firestore/metadata/V1/Query.php index 82262c56f263..5e45bd4eea7e 100644 Binary files a/Firestore/metadata/V1/Query.php and b/Firestore/metadata/V1/Query.php differ diff --git a/Firestore/src/V1/StructuredQuery/FindNearest.php b/Firestore/src/V1/StructuredQuery/FindNearest.php index 2688ef227d10..89c14d2d6907 100644 --- a/Firestore/src/V1/StructuredQuery/FindNearest.php +++ b/Firestore/src/V1/StructuredQuery/FindNearest.php @@ -46,6 +46,26 @@ class FindNearest extends \Google\Protobuf\Internal\Message * Generated from protobuf field .google.protobuf.Int32Value limit = 4 [(.google.api.field_behavior) = REQUIRED]; */ private $limit = null; + /** + * 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. + * + * Generated from protobuf field string distance_result_field = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $distance_result_field = ''; + /** + * 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 + * + * Generated from protobuf field .google.protobuf.DoubleValue distance_threshold = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $distance_threshold = null; /** * Constructor. @@ -65,6 +85,18 @@ class FindNearest extends \Google\Protobuf\Internal\Message * @type \Google\Protobuf\Int32Value $limit * Required. The number of nearest neighbors to return. Must be a positive * integer of no more than 1000. + * @type string $distance_result_field + * 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. + * @type \Google\Protobuf\DoubleValue $distance_threshold + * 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 * } */ public function __construct($data = NULL) { @@ -243,6 +275,123 @@ public function setLimitValue($var) $this->writeWrapperValue("limit", $var); return $this;} + /** + * 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. + * + * Generated from protobuf field string distance_result_field = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getDistanceResultField() + { + return $this->distance_result_field; + } + + /** + * 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. + * + * Generated from protobuf field string distance_result_field = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setDistanceResultField($var) + { + GPBUtil::checkString($var, True); + $this->distance_result_field = $var; + + return $this; + } + + /** + * 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 + * + * Generated from protobuf field .google.protobuf.DoubleValue distance_threshold = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\DoubleValue|null + */ + public function getDistanceThreshold() + { + return $this->distance_threshold; + } + + public function hasDistanceThreshold() + { + return isset($this->distance_threshold); + } + + public function clearDistanceThreshold() + { + unset($this->distance_threshold); + } + + /** + * Returns the unboxed value from 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 + * + * Generated from protobuf field .google.protobuf.DoubleValue distance_threshold = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return float|null + */ + public function getDistanceThresholdValue() + { + return $this->readWrapperValue("distance_threshold"); + } + + /** + * 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 + * + * Generated from protobuf field .google.protobuf.DoubleValue distance_threshold = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\DoubleValue $var + * @return $this + */ + public function setDistanceThreshold($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\DoubleValue::class); + $this->distance_threshold = $var; + + return $this; + } + + /** + * Sets the field by wrapping a primitive type in a Google\Protobuf\DoubleValue object. + + * 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 + * + * Generated from protobuf field .google.protobuf.DoubleValue distance_threshold = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param float|null $var + * @return $this + */ + public function setDistanceThresholdValue($var) + { + $this->writeWrapperValue("distance_threshold", $var); + return $this;} + } // Adding a class alias for backwards compatibility with the previous class name.