Skip to content

Commit

Permalink
Repair solr query.
Browse files Browse the repository at this point in the history
  • Loading branch information
Trey Terrell committed Mar 26, 2014
1 parent 7dcacba commit e0d7855
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/helpers/collections_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module CollectionsHelper
# TODO: We need to find a better way to do this - this means a solr call per facet. Fortunately, solr's fast.
def controlled_view(pid)
# Find documents which have info about this pid.
documents = (Blacklight.solr.get "select", :qt => "search", :q => "desc_metadata__*:#{pid}")["response"]["docs"]
documents = (Blacklight.solr.get "select", :params => {:qt => "search", :q => "#{RSolr.escape(pid)} -id:#{RSolr.escape(pid)}"})["response"]["docs"]
# Get the relevant fields only.
documents.map!{|x| x.select{|key, value| value.to_s.include?(pid)}}.reject!{|x| x.blank?}
return "" if documents.blank?
Expand Down

0 comments on commit e0d7855

Please sign in to comment.