Class: RediSearch::Create

Inherits:
Object
  • Object
show all
Defined in:
lib/redi_search/create.rb

Constant Summary collapse

OPTION_MAPPER =
{
  max_text_fields: "MAXTEXTFIELDS",
  no_offsets: "NOOFFSETS",
  no_highlight: "NOHL",
  no_fields: "NOFIELDS",
  no_frequencies: "NOFREQS"
}.freeze

Instance Method Summary collapse

Constructor Details

#initialize(index, schema, options) ⇒ Create

Returns a new instance of Create.



13
14
15
16
17
# File 'lib/redi_search/create.rb', line 13

def initialize(index, schema, options)
  @index = index
  @schema = schema
  @options = options
end

Instance Method Details

#callObject



23
24
25
26
27
# File 'lib/redi_search/create.rb', line 23

def call
  call!
rescue Redis::CommandError
  false
end

#call!Object



19
20
21
# File 'lib/redi_search/create.rb', line 19

def call!
  RediSearch.client.call!(*command).ok?
end