PERF: push reindex job to daily

This commit is contained in:
Sam 2014-07-01 10:09:55 +10:00
parent 20074a3140
commit 760e9a756d
3 changed files with 11 additions and 1 deletions

View File

@ -32,7 +32,6 @@ module Jobs
Post.rebake_old(250)
end
Search.rebuild_problem_posts
end
end

View File

@ -0,0 +1,10 @@
module Jobs
# if locale changes or search algorithm changes we may want to reindex stuff
class ReindexSearch < Jobs::Scheduled
every 1.day
def execute(args)
Search.rebuild_problem_posts
end
end
end

View File

@ -49,6 +49,7 @@ class Search
)', SiteSetting.default_locale).limit(10000)
posts.each do |post|
# force indexing
post.cooked += " "
SearchObserver.index(post)
end