Class: ThinkingSphinx::Interfaces::RealTime

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

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of RealTime.



4
5
6
7
8
9
10
# File 'lib/thinking_sphinx/interfaces/real_time.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/real_time.rb', line 12

def clear
  command :clear_real_time, :indices => indices
end

#indexObject



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

def index
  return if indices.empty?
  if !command :running
    stream.puts <<-TXT
The Sphinx daemon is not currently running. Real-time indices can only be
populated by sending commands to a running daemon.
    TXT
    return
  end

  command :index_real_time, :indices => indices
end