Skip to content

Commit

Permalink
get_search_results returns a duple of solr_response and solr_documen…
Browse files Browse the repository at this point in the history
…t_list, on the analogy of get_solr_response_for_doc_id
  • Loading branch information
Jonathan Rochkind committed Dec 2, 2009
1 parent 1d8bd27 commit 295beb9
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lib/blacklight/solr_helper.rb
Expand Up @@ -67,8 +67,15 @@ def solr_search_params(extra_controller_params={})
# given a user query, return a solr response containing both result docs and facets
# - mixes in the Blacklight::Solr::SpellingSuggestions module
# - the response will have a spelling_suggestions method
# Returns a two-element array (aka duple) with first the solr response object,
# and second an array of SolrDocuments representing the response.docs
def get_search_results(extra_controller_params={})
Blacklight.solr.find self.solr_search_params(extra_controller_params)
solr_response = Blacklight.solr.find( self.solr_search_params(extra_controller_params) )

document_list = solr_response.docs.collect {|doc| SolrDocument.new(doc)}

return [solr_response, document_list]

end

# returns a params hash for finding a single solr document (CatalogController #show action)
Expand Down

0 comments on commit 295beb9

Please sign in to comment.