lib/blacklight/solr/repository.rb in blacklight-8.3.0 vs lib/blacklight/solr/repository.rb in blacklight-8.4.0
- old
+ new
@@ -15,17 +15,24 @@
raise Blacklight::Exceptions::RecordNotFound if solr_response.documents.empty?
solr_response
end
+ # Find multiple documents by their ids
+ # @param [Hash] _params query parameters
+ def find_many(params)
+ search(params: params, path: blacklight_config.fetch_many_documents_path)
+ end
+
##
# Execute a search query against solr
# @param [Hash] params solr query parameters
- def search params = {}
- request_params = params.reverse_merge({ qt: blacklight_config.qt })
+ # @param [String] path solr request handler path
+ def search pos_params = {}, path: nil, params: nil, **kwargs
+ request_params = (params || pos_params).reverse_merge(kwargs).reverse_merge({ qt: blacklight_config.qt })
- send_and_receive search_path(request_params), request_params
+ send_and_receive(path || default_search_path(request_params), request_params)
end
# @param [Hash] request_params
# @return [Blacklight::Suggest::Response]
def suggestions(request_params)
@@ -124,10 +131,10 @@
[]
end
end
# @return [String]
- def search_path(solr_params)
+ def default_search_path(solr_params)
return blacklight_config.json_solr_path if blacklight_config.json_solr_path && uses_json_query_dsl?(solr_params)
blacklight_config.solr_path
end