Skip to content

Commit

Permalink
Merge pull request #6040 from avalonmediasystem/faster_orders
Browse files Browse the repository at this point in the history
Reduce max rows in solr queries to 100_000 to improve solr performance
  • Loading branch information
cjcolvar authored Sep 18, 2024
2 parents bdf83fb + a68db3c commit 0bfb424
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/models/media_object.rb
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ def to_solr(include_child_fields: false)
fill_in_solr_fields_that_need_sections(solr_doc)
elsif id.present? # avoid error in test suite
# Fill in other identifier so these values aren't stripped from the solr doc while waiting for the background job
mf_docs = ActiveFedora::SolrService.query("isPartOf_ssim:#{id}", rows: 1_000_000)
mf_docs = ActiveFedora::SolrService.query("isPartOf_ssim:#{id}", rows: 100_000)
solr_doc["other_identifier_sim"] += mf_docs.collect { |h| h['identifier_ssim'] }.flatten
end

Expand Down Expand Up @@ -470,7 +470,7 @@ def section_solr_docs
# in the section_list
return [] unless section_ids.present?
query = "id:" + section_ids.join(" id:")
@section_docs ||= ActiveFedora::SolrService.query(query, rows: 1_000_000)
@section_docs ||= ActiveFedora::SolrService.query(query, rows: 100_000)
end

def calculate_duration
Expand Down
3 changes: 3 additions & 0 deletions config/initializers/presenter_config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -115,4 +115,7 @@ def real_object
@real_object
end
end

# Reduce from 10_000_000 to reduce solr QTimes from triple digits to single digits
SpeedyAF::Base::SOLR_ALL = 100_000
end

0 comments on commit 0bfb424

Please sign in to comment.