If you are using acts_as_ferret, it will never get called.  The
acts_as_ferret declaration would go on the root class.  Updates to the
child classes would not trigger an aaf index update in the root class.

If you want to real-time index updates, you would have to add an
after_save callback to the child class that forces an aaf update in the
root class.

If real-time updates are not too important, then you could dump the child
updates into a queue that performs bulk updates.  This would minimize the
number of times this method gets called.

If you're worried about 200+ SQL calls, don't perform the join in ruby, do
it via SQL using CONCAT and "Advanced Attribute" as described in AWDWR,
19.3.

-Chris

On Tue, Nov 20, 2007 at 02:01:39PM +0100, Till Vollmer wrote:
> Hi,
> Thank you for the clue.
> Ok, like a virtual attribute. Works technically but:
> Downside: How often is that called ? Our tree has e.g. 200 children. This 
> means that the children are collected on every change of one of the 
> children (index) or?
> Any other ideas?
> Regards
> Till
>
>
> Am 20.11.2007 um 13:52 schrieb Chris Strom:
>
>> On Tue, Nov 20, 2007 at 01:17:30PM +0100, Till Vollmer wrote:
>>> Hi,
>>>
>>> Following problem:
>>>
>>> We have a tree structure with children and a root element (recursivly)
>>> stored in one table (imagine a threaded forum).
>>>
>>> Each of the children has a title which should be indexed by ferret.
>>>
>>> Now we want to make a search that returns only the root and searches all
>>> items.
>>>
>>>
>>> So if one node has "expensive" and nother node has "car" I want to enter
>>> "expensive car" in search and still find the root of all children (and
>>> only once!)
>>>
>>> Also paging should work as well.
>>>
>>> Any clues how to achieve that?
>>
>> An instance method in the root class to the effect of
>> children_titles_with_spaces would get you this.  That method would return
>> "expensive car" given your simple, two-node example, which would be
>> indexable with the normal analyzer.
>>
>> -Chris
>> _______________________________________________
>> Ferret-talk mailing list
>> [email protected]
>> http://rubyforge.org/mailman/listinfo/ferret-talk
>
> Codemart GmbH
> Till Vollmer
> Managing Director
> Tel: +49 (0)89 1213 5359
> Mob: + 49 (0)160 718 7403
> Fax: +49 (0)89 1892 1347
> Yahoo ID: till_vollmer
> Skype: till_vollmer
> www.codemart.de
> [EMAIL PROTECTED]
>
>
>
>
>

> _______________________________________________
> Ferret-talk mailing list
> [email protected]
> http://rubyforge.org/mailman/listinfo/ferret-talk
_______________________________________________
Ferret-talk mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/ferret-talk

Reply via email to