2014-01-07 11:52:29 +01:00
|
|
|
ThinkingSphinx::Index.define :comment, :with => :active_record do
|
|
|
|
indexes comment
|
2014-09-12 17:42:22 +02:00
|
|
|
indexes short_id
|
2014-01-07 11:52:29 +01:00
|
|
|
indexes user.username, :as => :author
|
|
|
|
|
2014-10-04 00:02:02 +02:00
|
|
|
has "(CAST(upvotes as #{Story.votes_cast_type}) - " <<
|
|
|
|
"CAST(downvotes as #{Story.votes_cast_type}))", :as => :score,
|
|
|
|
:type => :bigint, :sortable => true
|
2014-01-07 11:52:29 +01:00
|
|
|
|
|
|
|
has is_deleted
|
|
|
|
has created_at
|
|
|
|
|
|
|
|
where sanitize_sql(:is_deleted => false, :is_moderated => false)
|
|
|
|
end
|