Class: Redis::Commands::Search::VectorFieldDefinition
- Inherits:
-
Object
- Object
- Redis::Commands::Search::VectorFieldDefinition
- Defined in:
- lib/redis/commands/modules/search/schema.rb
Overview
The block DSL used by SchemaDefinition#vector_field to declare the attributes of a VectorField.
Instance Method Summary collapse
-
#dim(value) ⇒ Object
Set the vector dimensionality attribute.
-
#distance_metric(value) ⇒ Object
Set the distance metric attribute (e.g.
L2,COSINE). -
#initialize(field) ⇒ VectorFieldDefinition
constructor
A new instance of VectorFieldDefinition.
-
#type(value) ⇒ Object
Set the vector element type attribute (e.g.
FLOAT32).
Constructor Details
#initialize(field) ⇒ VectorFieldDefinition
Returns a new instance of VectorFieldDefinition.
181 182 183 |
# File 'lib/redis/commands/modules/search/schema.rb', line 181 def initialize(field) @field = field end |
Instance Method Details
#dim(value) ⇒ Object
Set the vector dimensionality attribute.
197 198 199 |
# File 'lib/redis/commands/modules/search/schema.rb', line 197 def dim(value) @field.add_attribute(:dim, value) end |
#distance_metric(value) ⇒ Object
Set the distance metric attribute (e.g. L2, COSINE).
205 206 207 |
# File 'lib/redis/commands/modules/search/schema.rb', line 205 def distance_metric(value) @field.add_attribute(:distance_metric, value) end |
#type(value) ⇒ Object
Set the vector element type attribute (e.g. FLOAT32).
189 190 191 |
# File 'lib/redis/commands/modules/search/schema.rb', line 189 def type(value) @field.add_attribute(:type, value) end |