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.
185 186 187 |
# File 'lib/redis/commands/modules/search/schema.rb', line 185 def initialize(field) @field = field end |
Instance Method Details
#dim(value) ⇒ Object
Set the vector dimensionality attribute.
201 202 203 |
# File 'lib/redis/commands/modules/search/schema.rb', line 201 def dim(value) @field.add_attribute(:dim, value) end |
#distance_metric(value) ⇒ Object
Set the distance metric attribute (e.g. L2, COSINE).
209 210 211 |
# File 'lib/redis/commands/modules/search/schema.rb', line 209 def distance_metric(value) @field.add_attribute(:distance_metric, value) end |
#type(value) ⇒ Object
Set the vector element type attribute (e.g. FLOAT32).
193 194 195 |
# File 'lib/redis/commands/modules/search/schema.rb', line 193 def type(value) @field.add_attribute(:type, value) end |