2014-01-07 11:52:29 +01:00
|
|
|
|
|
|
|
ThinkingSphinx::Index.define :comment, :with => :active_record do
|
|
|
|
indexes comment
|
|
|
|
indexes user.username, :as => :author
|
|
|
|
|
2014-01-09 06:02:01 +01:00
|
|
|
has "(cast(upvotes as integer) - cast(downvotes as integer))",
|
2014-01-07 11:52:29 +01:00
|
|
|
:as => :score, :type => :bigint, :sortable => true
|
|
|
|
|
|
|
|
has is_deleted
|
|
|
|
has created_at
|
|
|
|
|
|
|
|
where sanitize_sql(:is_deleted => false, :is_moderated => false)
|
|
|
|
end
|