On 10/2/06, Winton <[EMAIL PROTECTED]> wrote: > I am apart of a team that runs a student site called Studicious > (http://stu.dicio.us). We have been using Ferret from the beginning, and > recently added acts_as_ferret and sorting to the system. > > As you can see if you try the search, sorting is not working as > expected. I am using this code (w/ find_by_content): > > :sort => Ferret::Search::SortField.new(:school_sort, :reverse => false) > > :school_sort is an untokenized field with otherwise default settings. > Any ideas? > > - Winton >
Hi Winton, Sorry for the slow reply. Is it possible that one of your schools begins with a number? numbers appear in the database before letters so when Ferret detects the fields type it may think the field is an integer field. For example, imagine you are indexing tv shows. "24" would probably be the first entry in the index so when you try to sort by that field it will think it is an integer. So you need to specify that the field is in fact a string field. :sort => Ferret::Search::SortField.new(:school_sort, :type => :string, :reverse => false) I hope that helps, otherwise it really looks to me like the field is tokenized. I'd check that again just in case. Cheers, Dave PS: love the site design _______________________________________________ Ferret-talk mailing list [email protected] http://rubyforge.org/mailman/listinfo/ferret-talk

