2011-11-04 43 views
1

我在Ruby on Rails 3.1中實現了一個非常基本的Sunspot solr搜索。我使用整數列上的order_by參數調用了我的Idea模型上的搜索,但結果集沒有排序。在controller.rb太陽黑子搜索order_by錯誤 - 目標列沒有排序

搜索聲明:

@search = Idea.search do 
    fulltext params[:search] 
    order_by :num_users_joined, :desc 
end 
@idea_search_res = @search.results 

搜索規格書Idea.rb:

searchable do 
    text :text 
    integer :num_users_joined 
end 

當我通過結果集,並打印出num_users_joined的@idea_search_res迭代,我得到的東西像[4,2,3,1]。

謝謝

回答

0

問題消失了。我在Windows 7的VMWare中在Ubuntu 10.04上運行Sunspot。操作系統啓動!

我只是在Ubuntu 11.10上設置雙啓動,太陽黑子的搜索順序工作正常。我不知道有什麼不同。