uros wrote:
> > What do you mean by "loads all mentioned associations"? Do you mean it
> > instantiates ruby objects for them all?
> >
> I mean that whatevah is in define_index block gets executed. If you
> are referencing some child objects in there, all children get loaded
> in this block. Even in the case you dont need to load all child
> objects...

Pat might correct me here, but I'm pretty sure the define_index block is
only executed when the model is loaded. In development mode this is each
request, in production mode it's on app startup.

It also shouldn't be instantiating models, it just uses active record
associations to define the sphinc config.

> > That's what sphinx does directly. I think Thinking Sphinx might
> > instantiate the object and do some checks before deciding if rebuilding
> > the delta index is necessary.
> >
> If it does that, it could use AR methods to check if some fields
> changed, and only index those fields. If you have big objects with
> lots of child object, and you want to only update a flag on one main
> objects, all child objects will get loaded in the process and there
> will be several unneccesary hits to the db.

I think you could define your own Delta handler and control this process
more if you really need to. Check out my post of custom delat handlers
from a few days ago.

-- James Healy <jimmy-at-deefa-dot-com>  Tue, 01 Sep 2009 12:49:47 +1000

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Thinking Sphinx" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/thinking-sphinx?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to