sphinx casts integers to unsigned, screwing up score attributes
cast them as bigints closes #67
This commit is contained in:
parent
1b5b4823e9
commit
c8e5aa3cac
|
@ -28,8 +28,8 @@ class Comment < ActiveRecord::Base
|
|||
indexes comment
|
||||
indexes user.username, :as => :author
|
||||
|
||||
has "(upvotes - downvotes)", :as => :score, :type => :integer,
|
||||
:sortable => true
|
||||
has "(cast(upvotes as signed) - cast(downvotes as signed))",
|
||||
:as => :score, :type => :bigint, :sortable => true
|
||||
|
||||
has is_deleted
|
||||
has created_at
|
||||
|
|
|
@ -33,8 +33,8 @@ class Story < ActiveRecord::Base
|
|||
|
||||
has created_at, :sortable => true
|
||||
has hotness, is_expired
|
||||
has "(cast(upvotes as int) - cast(downvotes as int))",
|
||||
:as => :score, :type => :integer, :sortable => true
|
||||
has "(cast(upvotes as signed) - cast(downvotes as signed))",
|
||||
:as => :score, :type => :bigint, :sortable => true
|
||||
|
||||
set_property :field_weights => {
|
||||
:upvotes => 15,
|
||||
|
|
Loading…
Reference in a new issue