Skip to content

Commit

Permalink
Fixes SolrDocumet#members (#568)
Browse files Browse the repository at this point in the history
The 'rows' parameter was defaulting to 10, which was limiting the number of children
returned, which was causing instantiations to not be returned for PBCore XML exports
and pushes to AAPB. This fixes that, by setting the 'param' to arbitrarily high
number. Also, sets rows param for #member_of query.
  • Loading branch information
afred authored May 10, 2021
1 parent e59ef32 commit ef09f31
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/models/solr_document.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def digital_instantiation_id; id if is_digital_instantiation?; end
def members(only: [], except: [])
return [] if member_ids.empty?

@members ||= self.class.repository.search("q" => "+id:(#{member_ids.join(' OR ')})")['response']['docs'].map do |doc|
@members ||= self.class.repository.search(q: "+id:(#{member_ids.join(' OR ')})", rows: 99999)['response']['docs'].map do |doc|
SolrDocument.new(doc)
end

Expand All @@ -62,7 +62,7 @@ def members(only: [], except: [])
end

def member_of
self.class.repository.search("q" => "member_ids_ssim:#{id}")['response']['docs'].map do |doc|
self.class.repository.search(q: "member_ids_ssim:#{id}", rows: 99999)['response']['docs'].map do |doc|
SolrDocument.new(doc)
end
end
Expand Down

0 comments on commit ef09f31

Please sign in to comment.