Class: ThinkingSphinx::BatchedSearch

Inherits:
Object
  • Object
show all
Defined in:
lib/thinking_sphinx/batched_search.rb

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Constructor Details

- (BatchedSearch) initialize



4
5
6
# File 'lib/thinking_sphinx/batched_search.rb', line 4

def initialize
  @searches = []
end

Instance Attribute Details

- (Object) searches

Returns the value of attribute searches



2
3
4
# File 'lib/thinking_sphinx/batched_search.rb', line 2

def searches
  @searches
end

Instance Method Details

- (Object) populate(middleware = ThinkingSphinx::Middlewares::DEFAULT)



8
9
10
11
12
13
14
15
# File 'lib/thinking_sphinx/batched_search.rb', line 8

def populate(middleware = ThinkingSphinx::Middlewares::DEFAULT)
  return if populated? || searches.empty?

  middleware.call contexts
  searches.each &:populated!

  @populated = true
end