mirror of
https://github.com/discourse/discourse.git
synced 2025-04-30 13:04:34 +08:00
Load posts in batches while indexing problem posts.
This commit is contained in:
parent
0f2148be9b
commit
ce57ff9fcf
@ -51,7 +51,7 @@ class Search
|
|||||||
WHERE pd.post_id IS NULL
|
WHERE pd.post_id IS NULL
|
||||||
)', SiteSetting.default_locale).limit(10000)
|
)', SiteSetting.default_locale).limit(10000)
|
||||||
|
|
||||||
posts.each do |post|
|
posts.find_each do |post|
|
||||||
# force indexing
|
# force indexing
|
||||||
post.cooked += " "
|
post.cooked += " "
|
||||||
SearchIndexer.index(post)
|
SearchIndexer.index(post)
|
||||||
@ -64,7 +64,7 @@ class Search
|
|||||||
WHERE pd.topic_id IS NULL AND p2.post_number = 1
|
WHERE pd.topic_id IS NULL AND p2.post_number = 1
|
||||||
)', SiteSetting.default_locale).limit(10000)
|
)', SiteSetting.default_locale).limit(10000)
|
||||||
|
|
||||||
posts.each do |post|
|
posts.find_each do |post|
|
||||||
# force indexing
|
# force indexing
|
||||||
post.cooked += " "
|
post.cooked += " "
|
||||||
SearchIndexer.index(post)
|
SearchIndexer.index(post)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user