Class: DataMapper::SphinxManagedClient
- Inherits:
-
SphinxClient
- Object
- SphinxClient
- DataMapper::SphinxManagedClient
- Defined in:
- lib/dm-sphinx-adapter/sphinx_client.rb
Overview
Managed searchd if you don’t already have god/monit doing the job for you.
Requires you have daemon_controller installed.
Instance Method Summary collapse
-
#initialize(url_or_options) ⇒ SphinxManagedClient
constructor
A new instance of SphinxManagedClient.
- #search(*args) ⇒ Object
- #stop ⇒ Object
Methods inherited from SphinxClient
Constructor Details
#initialize(url_or_options) ⇒ SphinxManagedClient
Returns a new instance of SphinxManagedClient.
58 59 60 61 62 63 64 65 66 67 68 69 70 71 |
# File 'lib/dm-sphinx-adapter/sphinx_client.rb', line 58 def initialize() super # Fire up searchd. require 'daemon_controller' @client = DaemonController.new( :identifier => 'Sphinx searchd', :start_command => @config.searchd_bin, :stop_command => "#{@config.searchd_bin} --stop", :ping_command => method(:running?), :pid_file => @config.pid_file, :log_file => @config.log ) end |
Instance Method Details
#search(*args) ⇒ Object
73 74 75 |
# File 'lib/dm-sphinx-adapter/sphinx_client.rb', line 73 def search(*args) @client.connect{super} end |
#stop ⇒ Object
77 78 79 |
# File 'lib/dm-sphinx-adapter/sphinx_client.rb', line 77 def stop @client.stop end |