View Source GoogleApi.Datastore.V1.Model.FindNearest (google_api_datastore v0.25.0)

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.

Attributes

  • distanceMeasure (type: String.t, default: nil) - Required. The Distance Measure to use, required.
  • distanceResultProperty (type: String.t, default: nil) - Optional. Optional name of the field to output the result of the vector distance calculation. Must conform to entity property limitations.
  • distanceThreshold (type: float(), default: nil) - 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 (type: integer(), default: nil) - Required. The number of nearest neighbors to return. Must be a positive integer of no more than 100.
  • queryVector (type: GoogleApi.Datastore.V1.Model.Value.t, default: nil) - Required. The query vector that we are searching on. Must be a vector of no more than 2048 dimensions.
  • vectorProperty (type: GoogleApi.Datastore.V1.Model.PropertyReference.t, default: nil) - Required. An indexed vector property to search upon. Only documents which contain vectors whose dimensionality match the query_vector can be returned.

Summary

Functions

Unwrap a decoded JSON object into its complex fields.

Types

@type t() :: %GoogleApi.Datastore.V1.Model.FindNearest{
  distanceMeasure: String.t() | nil,
  distanceResultProperty: String.t() | nil,
  distanceThreshold: float() | nil,
  limit: integer() | nil,
  queryVector: GoogleApi.Datastore.V1.Model.Value.t() | nil,
  vectorProperty: GoogleApi.Datastore.V1.Model.PropertyReference.t() | nil
}

Functions

@spec decode(struct(), keyword()) :: struct()

Unwrap a decoded JSON object into its complex fields.