Forum: Ferret How to make a Tag cloud with Ferret ?

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
7bc1c1d2b813be5db6ea036a9da0e7ed?d=identicon&s=25 py landanger (Guest)
on 2007-05-14 17:17

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
28c237c0c414b644082bfcde4e42b309?d=identicon&s=25 John Leach (Guest)
on 2007-05-14 17:25
(Received via mailing list)

See TermEnum documentation:


On Mon, 2007-05-14 at 17:17 +0200, py landanger wrote:
7bc1c1d2b813be5db6ea036a9da0e7ed?d=identicon&s=25 py landanger (Guest)
on 2007-05-17 18:02
Thank you John  ^^
D148c5959e4eccc97f33244f1c5396e9?d=identicon&s=25 Benjamin Krause (Guest)
on 2007-05-19 11:00
(Received via mailing list)
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 ..


This topic is locked and can not be replied to.