0
Thinking_Sphinx有點麻煩。要白衣:思維獅身人面像不將屬性從:十進制轉換爲:在PostGresql中浮動
我有一個餐廳的模型,並具有下列關係的審查模式:
Restaurant Has_many Reviews through relationships
Review belongs_to Restaurant through relationships
每次審查有一個等級即關十進制系統,具有0.5的增量。
我搜索餐廳思考獅身人面像,並設置將評分爲屬性,如如下(我這樣做,所以結果降序評價值的順序排列):
has reviews.rating, :as => :review_rating, :type => :float
這是錯誤我得到的終端,當我思考指數斯芬克斯:
indexing index 'restaurant_core'...
ERROR: source 'restaurant_core_0': expected attr type ('uint' or 'timestamp' or 'bigint') in sql_attr_multi, got 'float review_rating from field'.
ERROR: index 'restaurant_core': failed to configure some of the sources, will not index.
有趣的故事:當我改變了:類型:整數,如下所示:
has reviews.rating, :as => :review_rating, :type => :integer
我沒有收到錯誤。
我運行Ruby on Rails的3.2.11,思考獅身人面像3.0.1,Ubuntu的12.10
任何幫助將不勝感激。