Module: Search::SolrDocument::ClassMethods

Defined in:
lib/solr/search.rb

Instance Method Summary collapse

Instance Method Details

#search(query, page = 1, opts = {}) ⇒ Object



5
6
7
8
9
10
11
# File 'lib/solr/search.rb', line 5

def search(query, page = 1, opts = {})
  WillPaginate::Collection.create(page, 20) do |pager|
    result,count = search_engine_query(query, opts)
    pager.replace(result)
    pager.total_entries = count
  end
end