To edit pages or tickets please login with username/password: aaf/aaf

Ticket #186 (assigned enhancement)

Opened 1 year ago

Last modified 1 year ago

Receive :include parameters when rebuilding index (allow eager loading)

Reported by: aaf Assigned to: jk (accepted)
Priority: major Milestone: 0.5
Component: 0plugin Version:
Keywords: Cc:

Description

Let's suppose you have 20000 entries in your database and you have to rebuild the index. The model is:

class Book < ActiveRecord::Base

belongs_to :author acts_as_ferret :fields => [:title, :author_name]

def author_name

return "#{self.author.first_name} #{self.author.last_name}"

end

end

So it will do 20000 + 20 queries in the database (if the batch_size is 1000) because rebuild_index doesn't get associations. If we can set :include => :book (maybe in acts_as_ferret options) it will reduce the queries total to only 20!

Change History

12/16/07 20:33:55 changed by jk

  • status changed from new to assigned.
  • type changed from defect to enhancement.

To edit pages or tickets please login with username/password: aaf/aaf