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):
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.
Would there be any way for it to still be tokenized when defining it as
‘school_sort’ => { :index => :untokenized }
in the model (a_a_f)? I just saw the other thread on sorting strangeness
and it seems like I am having similar problems. I will try that solution
and get back.
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.