Class: Redis::Commands::Search::GeoShapeField
| Relationships & Source Files | |
| Super Chains via Extension / Inclusion / Inheritance | |
|
Class Chain:
self,
Field
|
|
|
Instance Chain:
self,
Field
|
|
| Inherits: |
Redis::Commands::Search::Field
|
| Defined in: | lib/redis/commands/modules/search/field.rb |
Overview
A GEOSHAPE field, indexing geometric shapes under a coordinate system.
Constant Summary
-
FLAT =
# File 'lib/redis/commands/modules/search/field.rb', line 192"FLAT" -
SPHERICAL =
# File 'lib/redis/commands/modules/search/field.rb', line 193"SPHERICAL"
Class Method Summary
-
.new(name, coord_system = nil, **options) ⇒ GeoShapeField
constructor
Build a
GEOSHAPEfield.
Field - Inherited
| .new | Build a field definition. |
Instance Attribute Summary
Instance Method Summary
-
#to_args ⇒ Array
Render this field as the array of
FT.CREATESCHEMAtokens.
Field - Inherited
| #to_args | Render this field as the array of |
Constructor Details
.new(name, coord_system = nil, **options) ⇒ GeoShapeField
Build a GEOSHAPE field.
# File 'lib/redis/commands/modules/search/field.rb', line 203
def initialize(name, coord_system = nil, **) super(name, :geoshape, nil, **) @coord_system = coord_system end
Instance Method Details
#to_args ⇒ Array
Render this field as the array of FT.CREATE SCHEMA tokens.
# File 'lib/redis/commands/modules/search/field.rb', line 211
def to_args args = [@name] args << "AS" << @alias_name if @alias_name args << @type.to_s.upcase args << @coord_system if @coord_system # Add suffix options (order mirrors the base Field: NOINDEX, INDEXMISSING, SORTABLE). # GEOSHAPE supports INDEXMISSING but not INDEXEMPTY/WITHSUFFIXTRIE. args << "NOINDEX" if @options[:no_index] args << "INDEXMISSING" if @options[:index_missing] args << "SORTABLE" if @options[:sortable] args end