Hi there,
I'm having some strange sorting stuff goign on. Here's my search method:
sort_fields = []
sort_fields << Ferret::Search::SortField.new("name",
:reverse => :false)
@results = Listing.find_by_contents @search_criteria, :limit => :all,
:sort => sort_fields
page = (params[:page] ||= 1).to_i
items_per_page = 9
offset = (page - 1) * items_per_page
@pages = Paginator.new(self, @results.length, items_per_page, page)
@results = @results[offset..(offset + items_per_page - 1)]
For some queries, the sorting is correct. Other times, it's not. I'm not
sure what's causing this. Any help would be greatly appreciated!
We're using ferret 10.3, I believe.
Thanks.
--
Posted via http://www.ruby-forum.com/.
_______________________________________________
Ferret-talk mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/ferret-talk