Skip to content
This repository has been archived by the owner on Mar 24, 2020. It is now read-only.

Commit

Permalink
Update metadata only collections query
Browse files Browse the repository at this point in the history
  • Loading branch information
VivianChu committed Jul 13, 2018
1 parent 7a32ced commit 0eb6ed2
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions app/controllers/catalog_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -320,14 +320,11 @@ def collection_search

def metadata_only_collections
meta_colls = []
params = { q: 'visibility_tesim:local OR visibility_tesim:public', fq: 'type_tesim:Collection' }
response = raw_solr(params)
other_rights_fquery = '(otherRights_tesim:localDisplay OR otherRights_tesim:metadataDisplay)'
params = { fq: "{!join from=collections_tesim to=id}#{other_rights_fquery}", q: 'type_tesim:Collection', rows: 300 }
response = raw_solr(params)
response.docs.each do |doc|
collection_solr_params = { q: "collections_tesim:#{doc['id']}", fq: other_rights_fquery, rows: 1 }
collection_response = raw_solr(collection_solr_params)
metadata_only = !collection_response.response['numFound'].zero?
meta_colls << doc['id_t'].to_s if metadata_only
meta_colls << doc['id_t']
end
meta_colls
end
Expand Down

0 comments on commit 0eb6ed2

Please sign in to comment.