diff --git a/app/models/bulletin.rb b/app/models/bulletin.rb index bb3eec9..b752a89 100644 --- a/app/models/bulletin.rb +++ b/app/models/bulletin.rb @@ -85,6 +85,8 @@ class Bulletin scope :filter_cats_and_tags, ->(cats,tags) {filter_by_widget_categories(cats,false).filter_by_tags(tags)} before_create :set_expire before_save :check_limit + index({postdate: 1}, { unique: false, background: true }) + index({is_top: -1,postdate: -1, _id: -1}, { unique: false, background: true }) def to_calendar_param self.to_param end