Class: Google::Apis::FirestoreV1beta1::FindNearest

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable, Core::JsonObjectSupport
Defined in:
lib/google/apis/firestore_v1beta1/classes.rb,
lib/google/apis/firestore_v1beta1/representations.rb,
lib/google/apis/firestore_v1beta1/representations.rb

Overview

Nearest Neighbors search config.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ FindNearest

Returns a new instance of FindNearest.



1125
1126
1127
# File 'lib/google/apis/firestore_v1beta1/classes.rb', line 1125

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#distance_measure ⇒ String

Required. The Distance Measure to use, required. Corresponds to the JSON property distanceMeasure

Returns:

  • (String)


1107
1108
1109
# File 'lib/google/apis/firestore_v1beta1/classes.rb', line 1107

def distance_measure
  @distance_measure
end

#limit ⇒ Fixnum

Required. The number of nearest neighbors to return. Must be a positive integer of no more than 1000. Corresponds to the JSON property limit

Returns:

  • (Fixnum)


1113
1114
1115
# File 'lib/google/apis/firestore_v1beta1/classes.rb', line 1113

def limit
  @limit
end

#query_vector ⇒ Google::Apis::FirestoreV1beta1::Value

A message that can hold any of the supported value types. Corresponds to the JSON property queryVector



1118
1119
1120
# File 'lib/google/apis/firestore_v1beta1/classes.rb', line 1118

def query_vector
  @query_vector
end

#vector_field ⇒ Google::Apis::FirestoreV1beta1::FieldReference

A reference to a field in a document, ex: stats.operations. Corresponds to the JSON property vectorField



1123
1124
1125
# File 'lib/google/apis/firestore_v1beta1/classes.rb', line 1123

def vector_field
  @vector_field
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



1130
1131
1132
1133
1134
1135
# File 'lib/google/apis/firestore_v1beta1/classes.rb', line 1130

def update!(**args)
  @distance_measure = args[:distance_measure] if args.key?(:distance_measure)
  @limit = args[:limit] if args.key?(:limit)
  @query_vector = args[:query_vector] if args.key?(:query_vector)
  @vector_field = args[:vector_field] if args.key?(:vector_field)
end