Class: ThinkingSphinx::Interfaces::SQL

Inherits:
Base
  • Object
show all
Defined in:
lib/thinking_sphinx/interfaces/sql.rb

Instance Method Summary collapse

Constructor Details

#initialize(configuration, options, stream = STDOUT) ⇒ SQL

Returns a new instance of SQL.



4
5
6
7
8
9
10
# File 'lib/thinking_sphinx/interfaces/sql.rb', line 4

def initialize(configuration, options, stream = STDOUT)
  super

  configuration.preload_indices

  command :prepare
end

Instance Method Details

#clearObject



12
13
14
# File 'lib/thinking_sphinx/interfaces/sql.rb', line 12

def clear
  command :clear_sql, :indices => (filtered? ? filtered_indices : indices)
end

#index(reconfigure = true, verbose = nil) ⇒ Object



16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/thinking_sphinx/interfaces/sql.rb', line 16

def index(reconfigure = true, verbose = nil)
  stream.puts <<-TXT unless verbose.nil?
The verbose argument to the index method is now deprecated, and can instead be
managed by the :verbose option passed in when initialising RakeInterface. That
option is set automatically when invoked by rake, via rake's --silent and/or
--quiet arguments.
  TXT
  return if indices.empty?

  command :configure if reconfigure
  command :index_sql,
    :indices => (filtered? ? filtered_indices.collect(&:name) : nil)
end

#mergeObject



30
31
32
# File 'lib/thinking_sphinx/interfaces/sql.rb', line 30

def merge
  command :merge_and_update
end