PERF: push reindex job to daily
This commit is contained in:
parent
20074a3140
commit
760e9a756d
|
@ -32,7 +32,6 @@ module Jobs
|
||||||
Post.rebake_old(250)
|
Post.rebake_old(250)
|
||||||
end
|
end
|
||||||
|
|
||||||
Search.rebuild_problem_posts
|
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -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
|
|
@ -49,6 +49,7 @@ class Search
|
||||||
)', SiteSetting.default_locale).limit(10000)
|
)', SiteSetting.default_locale).limit(10000)
|
||||||
|
|
||||||
posts.each do |post|
|
posts.each do |post|
|
||||||
|
# force indexing
|
||||||
post.cooked += " "
|
post.cooked += " "
|
||||||
SearchObserver.index(post)
|
SearchObserver.index(post)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue