Class: ThinkingSphinx::Search::BatchInquirer
- Inherits:
-
Object
- Object
- ThinkingSphinx::Search::BatchInquirer
- Defined in:
- lib/thinking_sphinx/search/batch_inquirer.rb
Instance Method Summary collapse
- #append_query(query) ⇒ Object
-
#initialize {|_self| ... } ⇒ BatchInquirer
constructor
A new instance of BatchInquirer.
- #results ⇒ Object
Constructor Details
#initialize {|_self| ... } ⇒ BatchInquirer
Returns a new instance of BatchInquirer.
4 5 6 7 8 |
# File 'lib/thinking_sphinx/search/batch_inquirer.rb', line 4 def initialize(&block) @queries = [] yield self if block_given? end |
Instance Method Details
#append_query(query) ⇒ Object
10 11 12 |
# File 'lib/thinking_sphinx/search/batch_inquirer.rb', line 10 def append_query(query) @queries << query end |
#results ⇒ Object
14 15 16 17 18 19 20 21 22 |
# File 'lib/thinking_sphinx/search/batch_inquirer.rb', line 14 def results @results ||= begin @queries.freeze ThinkingSphinx::Connection.take do |connection| connection.query_all *@queries end end end |