How to make a Tag cloud with Ferret?


I want to make a TAG CLOUD using ferret.
How can i do so ?

I would need to know the amount of keyword for every each words in the

Thank you


See TermEnum documentation:


On Mon, 2007-05-14 at 17:17 +0200, py landanger wrote:

Thank you John ^^

Hey John…

well, thats a tough question, esp. as there is no ‘general rule’ on
how a tag could should
look like and which criteria should be taken into account…

is based on ferret… but we’re storing a :popularity for each tag…
and ferret is simply
sorting its index using the popularity …

here’s what we do [1]:

def popular_categories_by_type( root_id )
query =
query.add_query( :type,
Category.to_s.downcase ), :must )
query.add_query( :root_id, root_id.to_s ), :must )
query.add_query( :is_assignable, ‘1’ ), :must )
order = orderfield( [ “popularity”.to_sym ], :type
=> :integer, :reverse => true )
objects = self.real_search( query, :limit => 30, :order => order )

hope that helps …