Skip to content

Commit

Permalink
Rename SearchHelper#get_solr_response_for_document_ids to SearchHelpe…
Browse files Browse the repository at this point in the history
…r#fetch_many
  • Loading branch information
jcoyne authored and cbeer committed Feb 23, 2015
1 parent 6c2c787 commit 22ed5de
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
4 changes: 2 additions & 2 deletions lib/blacklight/bookmarks.rb
Expand Up @@ -22,7 +22,7 @@ module Blacklight::Bookmarks
def action_documents
bookmarks = token_or_current_or_guest_user.bookmarks
bookmark_ids = bookmarks.collect { |b| b.document_id.to_s }
get_solr_response_for_document_ids(bookmark_ids)
fetch_many(bookmark_ids)
end

def action_success_redirect_path
Expand All @@ -39,7 +39,7 @@ def index
@bookmarks = token_or_current_or_guest_user.bookmarks
bookmark_ids = @bookmarks.collect { |b| b.document_id.to_s }

@response, @document_list = get_solr_response_for_document_ids(bookmark_ids)
@response, @document_list = fetch_many(bookmark_ids)

respond_to do |format|
format.html { }
Expand Down
2 changes: 1 addition & 1 deletion lib/blacklight/catalog.rb
Expand Up @@ -106,7 +106,7 @@ def opensearch
end

def action_documents
get_solr_response_for_document_ids(params[:id])
fetch_many(params[:id])
end

def action_success_redirect_path
Expand Down
11 changes: 7 additions & 4 deletions lib/blacklight/search_helper.rb
Expand Up @@ -147,10 +147,9 @@ def fetch(id=nil, extra_controller_params={})

##
# Retrieve a set of documents by id
# @overload get_solr_response_for_document_ids(ids, extra_controller_params)
# @overload get_solr_response_for_document_ids(ids, user_params, extra_controller_params)
def get_solr_response_for_document_ids(ids=[], *args)
# user_params = params || {}, extra_controller_params = {}
# @overload fetch_many(ids, extra_controller_params)
# @overload fetch_many(ids, user_params, extra_controller_params)
def fetch_many(ids=[], *args)
if args.length == 1
user_params = params
extra_controller_params = args.first || {}
Expand All @@ -166,6 +165,10 @@ def get_solr_response_for_document_ids(ids=[], *args)
[solr_response, solr_response.documents]
end

alias_method :get_solr_response_for_document_ids, :fetch_many
deprecation_deprecate get_solr_response_for_document_ids: "use fetch_many(ids) instead"


# given a field name and array of values, get the matching SOLR documents
# @return [Blacklight::SolrResponse, Array<Blacklight::SolrDocument>] the solr response object and a list of solr documents
def get_solr_response_for_field_values(field, values, extra_controller_params = {})
Expand Down

0 comments on commit 22ed5de

Please sign in to comment.