mirror of
https://github.com/discourse/discourse.git
synced 2025-05-30 15:28:37 +08:00
FIX: reindex_search job should work on model with no search data (#11819)
Lots of changes but it's mostly a refactoring. The interesting part that was fix are the 'load_problem_<model>_ids' methods. They will now return records with no search data associated so they can be properly indexed for the search. This "bad" state usually happens after a migration.
This commit is contained in:
@ -961,7 +961,7 @@ describe Search do
|
||||
|
||||
it 'can find posts with tags' do
|
||||
# we got to make this index (it is deferred)
|
||||
Jobs::ReindexSearch.new.rebuild_problem_posts
|
||||
Jobs::ReindexSearch.new.rebuild_posts
|
||||
|
||||
result = Search.execute(tag.name)
|
||||
expect(result.posts.length).to eq(1)
|
||||
@ -977,7 +977,7 @@ describe Search do
|
||||
|
||||
it 'can find posts with tag synonyms' do
|
||||
synonym = Fabricate(:tag, name: 'synonym', target_tag: tag)
|
||||
Jobs::ReindexSearch.new.rebuild_problem_posts
|
||||
Jobs::ReindexSearch.new.rebuild_posts
|
||||
result = Search.execute(synonym.name)
|
||||
expect(result.posts.length).to eq(1)
|
||||
end
|
||||
|
Reference in New Issue
Block a user