Skip to content

Commit

Permalink
Add SearchBuilder#where
Browse files Browse the repository at this point in the history
  • Loading branch information
cbeer committed Feb 25, 2015
1 parent 708963d commit 47cc3eb
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
7 changes: 7 additions & 0 deletions lib/blacklight/search_builder.rb
Expand Up @@ -20,6 +20,13 @@ def with blacklight_params = {}
self
end

##
# Update the :q (query) parameter
def where conditions
@blacklight_params[:q] = conditions
self
end

##
# Append additional processor chain directives
def append *addl_processor_chain
Expand Down
5 changes: 4 additions & 1 deletion lib/blacklight/search_helper.rb
Expand Up @@ -270,7 +270,10 @@ def fetch_many(ids=[], *args)
extra_controller_params ||= {}
end

query = search_builder.with(user_params).query(extra_controller_params.merge(solr_document_ids_params(ids)))
query = search_builder.
with(user_params).
where(blacklight_config.document_model.unique_key => ids).
query(extra_controller_params.merge(fl: '*'))
solr_response = repository.search(query)

[solr_response, solr_response.documents]
Expand Down

0 comments on commit 47cc3eb

Please sign in to comment.