Class: Redis::Commands::Search::VectorFieldDefinition
| Relationships & Source Files | |
| Inherits: | Object |
| 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.
Class Method Summary
- .new(field) ⇒ VectorFieldDefinition constructor
Instance Method Summary
-
#dim(value) ⇒ Object
Set the vector dimensionality attribute.
-
#distance_metric(value) ⇒ Object
Set the distance metric attribute (e.g.
-
#type(value) ⇒ Object
Set the vector element type attribute (e.g.
Constructor Details
.new(field) ⇒ VectorFieldDefinition
# 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.
# 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).
# 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).
# File 'lib/redis/commands/modules/search/schema.rb', line 189
def type(value) @field.add_attribute(:type, value) end