sphinx casts integers to unsigned, screwing up score attributes

cast them as bigints

closes #67
This commit is contained in:
joshua stein 2013-12-19 16:03:04 -06:00
parent 1b5b4823e9
commit c8e5aa3cac
2 changed files with 4 additions and 4 deletions

View file

@ -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

View file

@ -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,