journalduhacker/app/indices/comment_index.rb

15 lines
415 B
Ruby
Raw Normal View History

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