Skip to content

Commit

Permalink
Use the jump tables to optimize relattion size
Browse files Browse the repository at this point in the history
  • Loading branch information
xhero committed Dec 10, 2024
1 parent b3753b4 commit 46e22ef
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions app/models/person.rb
Original file line number Diff line number Diff line change
Expand Up @@ -281,11 +281,15 @@ def reindex
:join => { :from => :item_id, :to => :id })

sunspot_dsl.integer :src_count_order, :stored => true do
referring_sources.size + referring_holdings.size
#referring_sources.size + referring_holdings.size
# Use the jump table directly
source_person_relations.size + holding_person_relations.size
end

sunspot_dsl.integer :publications_count_order, :stored => true do
referring_publications.size
#referring_publications.size
# same as above
publication_person_relations.size
end

MarcIndex::attach_marc_index(sunspot_dsl, self.to_s.downcase)
Expand Down

0 comments on commit 46e22ef

Please sign in to comment.