Hello, 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 index. Thank you
on 2007-05-14 17:17
on 2007-05-14 17:25
Hello, See TermEnum documentation: http://ferret.davebalmain.com/api/classes/Ferret/I... John. On Mon, 2007-05-14 at 17:17 +0200, py landanger wrote: > -- http://johnleach.co.uk
on 2007-05-17 18:02
Thank you John ^^
on 2007-05-19 11:00
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.. http://www.omdb.org/encyclopedia 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 : def popular_categories_by_type( root_id ) query = BooleanQuery.new query.add_query( TermQuery.new( :type, Category.to_s.downcase ), :must ) query.add_query( TermQuery.new( :root_id, root_id.to_s ), :must ) query.add_query( TermQuery.new( :is_assignable, '1' ), :must ) order = orderfield( [ "popularity".to_sym ], :type => :integer, :reverse => true ) objects = self.real_search( query, :limit => 30, :order => order ) end hope that helps .. Ben  http://bugs.omdb.org/browser/trunk/lib/omdb/ferret...