Firestore in Datastore mode V1 API - Class Google::Cloud::Datastore::V1::FindNearest (v1.1.0)

Reference documentation and code samples for the Firestore in Datastore mode V1 API class Google::Cloud::Datastore::V1::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.

Inherits

  • Object

Extended By

  • Google::Protobuf::MessageExts::ClassMethods

Includes

  • Google::Protobuf::MessageExts

Methods

#distance_measure

def distance_measure() -> ::Google::Cloud::Datastore::V1::FindNearest::DistanceMeasure
Returns

#distance_measure=

def distance_measure=(value) -> ::Google::Cloud::Datastore::V1::FindNearest::DistanceMeasure
Parameter
Returns

#distance_result_property

def distance_result_property() -> ::String
Returns
  • (::String) — Optional. Optional name of the field to output the result of the vector distance calculation. Must conform to [entity property][google.datastore.v1.Entity.properties] limitations.

#distance_result_property=

def distance_result_property=(value) -> ::String
Parameter
  • value (::String) — Optional. Optional name of the field to output the result of the vector distance calculation. Must conform to [entity property][google.datastore.v1.Entity.properties] limitations.
Returns
  • (::String) — Optional. Optional name of the field to output the result of the vector distance calculation. Must conform to [entity property][google.datastore.v1.Entity.properties] limitations.

#distance_threshold

def distance_threshold() -> ::Google::Protobuf::DoubleValue
Returns
  • (::Google::Protobuf::DoubleValue) — 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

#distance_threshold=

def distance_threshold=(value) -> ::Google::Protobuf::DoubleValue
Parameter
  • value (::Google::Protobuf::DoubleValue) — 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

Returns
  • (::Google::Protobuf::DoubleValue) — 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

#limit

def limit() -> ::Google::Protobuf::Int32Value
Returns

#limit=

def limit=(value) -> ::Google::Protobuf::Int32Value
Parameter
Returns

#query_vector

def query_vector() -> ::Google::Cloud::Datastore::V1::Value
Returns

#query_vector=

def query_vector=(value) -> ::Google::Cloud::Datastore::V1::Value
Parameter
Returns

#vector_property

def vector_property() -> ::Google::Cloud::Datastore::V1::PropertyReference
Returns

#vector_property=

def vector_property=(value) -> ::Google::Cloud::Datastore::V1::PropertyReference
Parameter
Returns