FIX: search couldn't find tags from before 2017-08-25

This commit is contained in:
Neil Lalonde 2017-10-24 17:55:05 -04:00
parent 5f47a4807b
commit 2c15e9c6fe
2 changed files with 18 additions and 0 deletions

View File

@ -0,0 +1,9 @@
module Jobs
class CreateTagsSearchIndex < Jobs::Onceoff
def execute_onceoff(args)
Tag.exec_sql('select id, name from tags').each do |t|
SearchIndexer.update_tags_index(t['id'], t['name'])
end
end
end
end

View File

@ -42,6 +42,15 @@ def reindex_search(db = RailsMultisite::ConnectionManagement.current_db)
id = c["id"] id = c["id"]
name = c["name"] name = c["name"]
SearchIndexer.update_categories_index(id, name) SearchIndexer.update_categories_index(id, name)
putc '.'
end
puts '', 'Tags'
Tag.exec_sql('select id, name from tags').each do |t|
SearchIndexer.update_tags_index(t['id'], t['name'])
putc '.'
end end
puts puts