class RediSearch::Schema::TextField

Attributes

no_index[R]
no_stem[R]
phonetic[R]
sortable[R]
weight[R]

Public Class Methods

new(name, weight: 1.0, phonetic: nil, sortable: false, no_index: false, no_stem: false) click to toggle source
# File lib/redi_search/schema/text_field.rb, line 6
def initialize(name, weight: 1.0, phonetic: nil, sortable: false,
               no_index: false, no_stem: false)
  @name = name
  @weight = weight
  @phonetic = phonetic
  @sortable = sortable
  @no_index = no_index
  @no_stem = no_stem
end

Public Instance Methods

to_a() click to toggle source
# File lib/redi_search/schema/text_field.rb, line 16
def to_a
  query = [name.to_s, "TEXT"]
  query += ["WEIGHT", weight] if weight
  query += ["PHONETIC", phonetic] if phonetic
  query += boolean_options_string

  query
end

Private Instance Methods

boolean_options() click to toggle source
# File lib/redi_search/schema/text_field.rb, line 29
def boolean_options
  %i(sortable no_index no_stem)
end