Hi all,

I'm quite new to ferret and acts_as_ferret and what to see if I can
implement the following requirement using them.

Suppose I have two model classes: Article and Comment. It's obvious that
one article may have many comments, so this is a one-many relationship.
If I want to add full text search to these models, I'm supposed to use
acts_as_ferret in both of the classes.

Now say I what to search for "rails" in all of these documents, ferret
will simply return all the models it found, say article1, comment1 and
comment2. The problem is that, there is a chance(and not that small)
that comment1 or/and comment2 belong(s) to article1, in which case I
want to show just article1 with all its comments.

Of course I can go through the result set and write some logic to do
this. But I think acts_as_ferret should be able to solve at least part
of this problem. Is there an existing way to do this? If not, is there
any thought about adding this in the future?

Thanks.

-- 
Posted via http://www.ruby-forum.com/.
_______________________________________________
Ferret-talk mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/ferret-talk

Reply via email to