diff --git a/app/jobs/onceoff/create_tags_search_index.rb b/app/jobs/onceoff/create_tags_search_index.rb new file mode 100644 index 00000000000..3e673bf2e69 --- /dev/null +++ b/app/jobs/onceoff/create_tags_search_index.rb @@ -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 diff --git a/lib/tasks/search.rake b/lib/tasks/search.rake index ef84747cce4..7d1ce3ab30c 100644 --- a/lib/tasks/search.rake +++ b/lib/tasks/search.rake @@ -42,6 +42,15 @@ def reindex_search(db = RailsMultisite::ConnectionManagement.current_db) id = c["id"] name = c["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 puts