i have been trying to get this to work for a while now. my controller is sort = [ Ferret::Search::SortField::SCORE_REV ] @results = Record.multi_search(params[:search_terms], [ Link, Post, Event ], {:limit => :all, :sort => sort }) and in my view i just render a conglomeration of the appropriate partials for each model. it seems that no matter what i do, i can''t get the results to be ordered by their ferret_score, even though i can display that score just fine in my views. i''m really confused and getting frustrated. maybe someone can shed some light on it. thanks! here is a sample model : acts_as_ferret :store_class_name => true, :fields => [:title, :body] and the main view : <% for r in @results %> <%= r.ferret_score %> <p><%= render_partial Inflector.underscore(r.class), r %></p> <% end %> Jon -- Posted via http://www.ruby-forum.com/.
Jens Kraemer
2007-May-23 08:40 UTC
[Ferret-talk] Bug in Ferret::Search::SortField::SCORE ??
On Tue, May 22, 2007 at 07:49:15PM +0200, Jon Druse wrote:> i have been trying to get this to work for a while now. my controller > is > > sort = [ Ferret::Search::SortField::SCORE_REV ] > @results = Record.multi_search(params[:search_terms], [ Link, Post, > Event ], {:limit => :all, :sort => sort }) > > and in my view i just render a conglomeration of the appropriate > partials for each model. it seems that no matter what i do, i can''t get > the results to be ordered by their ferret_score, even though i can > display that score just fine in my views. i''m really confused and > getting frustrated. maybe someone can shed some light on it. thanks!What version of aaf/Ferret do you use? I just added some more tests to aaf trunk and it seems to work ok. Jens -- Jens Kr?mer webit! Gesellschaft f?r neue Medien mbH Schnorrstra?e 76 | 01069 Dresden Telefon +49 351 46766-0 | Telefax +49 351 46766-66 kraemer at webit.de | www.webit.de Amtsgericht Dresden | HRB 15422 GF Sven Haubold, Hagen Malessa