Hi Jens, Thankyou for getting back so quickly. I should have given more information about the problem tho. One of the fields contains about 35 predefined values. I hope there is a more efficient way of producing these counts or I may well have to drop this functionality from the app. Any other ideas? I really appreciate the speed with which people reply on this forum. Regards c
Jens Kraemer wrote: > On Thu, Sep 07, 2006 at 04:58:08PM +0200, Caspar wrote: >> there can be "mouse", "cat", "fish". >> A perfect sollution would be to have the results set has some extra >> attributes like results.cat_hits (that would be amazing) In reality >> there needs to be counts for 5 different fields. >> >> So is this something that ferret can do easily? >> How do i get ferret and aaf to produce this data for each search result? >> What should i go and investigate? > > I'd first try to just issue a seperate query for each of your special > terms (ANDed with the original query), and take it's result count. > > Ideally you wouldn't use find_by_contents for this (because it fetches > results from the db, which you don't want here), but use something like > > VoObject.ferret_index.search(query + " AND cat",...).total_hits > > > Jens > > -- > webit! Gesellschaft f�r neue Medien mbH www.webit.de > Dipl.-Wirtschaftsingenieur Jens Kr�mer [EMAIL PROTECTED] > Schnorrstra�e 76 Tel +49 351 46766 0 > D-01069 Dresden Fax +49 351 46766 66 -- Posted via http://www.ruby-forum.com/. _______________________________________________ Ferret-talk mailing list [email protected] http://rubyforge.org/mailman/listinfo/ferret-talk

