search: fix order:note, order:comment_bumped to use indexes.

This commit is contained in:
evazion
2017-05-19 17:04:51 -05:00
parent d74eda2b96
commit fad4d48b1c
4 changed files with 17 additions and 4 deletions

View File

@@ -78,7 +78,7 @@ private
end
def index_by_post
@posts = Post.where("last_comment_bumped_at IS NOT NULL").tag_match(params[:tags]).reorder("last_comment_bumped_at DESC").paginate(params[:page], :limit => 5, :search_count => params[:search])
@posts = Post.where("last_comment_bumped_at IS NOT NULL").tag_match(params[:tags]).reorder("last_comment_bumped_at DESC NULLS LAST").paginate(params[:page], :limit => 5, :search_count => params[:search])
@posts.each # hack to force rails to eager load
respond_with(@posts) do |format|
format.html {render :action => "index_by_post"}