class ThinkingSphinx::Connection::Client

Public Instance Methods

close() click to toggle source
# File lib/thinking_sphinx/connection.rb, line 68
def close
  client.close unless ThinkingSphinx::Connection.persistent?
end
execute(statement) click to toggle source
# File lib/thinking_sphinx/connection.rb, line 72
def execute(statement)
  query(statement).first
end
query_all(*statements) click to toggle source
# File lib/thinking_sphinx/connection.rb, line 76
def query_all(*statements)
  query *statements
end

Private Instance Methods

close_and_clear() click to toggle source
# File lib/thinking_sphinx/connection.rb, line 82
def close_and_clear
  client.close
  @client = nil
end
query(*statements) click to toggle source
# File lib/thinking_sphinx/connection.rb, line 87
def query(*statements)
  results_for *statements
rescue => error
  message           = "#{error.message} - #{statements.join('; ')}"
  wrapper           = ThinkingSphinx::QueryExecutionError.new message
  wrapper.statement = statements.join('; ')
  raise wrapper
ensure
  close_and_clear unless ThinkingSphinx::Connection.persistent?
end