class ThinkingSphinx::Connection::Client
Public Instance Methods
close()
click to toggle source
# File lib/thinking_sphinx/connection.rb, line 66 def close client.close unless ThinkingSphinx::Connection.persistent? end
execute(statement)
click to toggle source
# File lib/thinking_sphinx/connection.rb, line 70 def execute(statement) query(statement).first end
query_all(*statements)
click to toggle source
# File lib/thinking_sphinx/connection.rb, line 74 def query_all(*statements) query *statements end
Private Instance Methods
close_and_clear()
click to toggle source
# File lib/thinking_sphinx/connection.rb, line 80 def close_and_clear client.close @client = nil end
query(*statements)
click to toggle source
# File lib/thinking_sphinx/connection.rb, line 85 def query(*statements) results_for *statements rescue => error wrapper = ThinkingSphinx::QueryExecutionError.new error.message wrapper.statement = statements.join('; ') raise wrapper ensure close_and_clear unless ThinkingSphinx::Connection.persistent? end