Commit 9c411756 authored by Valery Sizov's avatar Valery Sizov

ES: Add more rake task

parent 1921c963
......@@ -4,6 +4,8 @@ v 8.8.0 (unreleased)
- [Elastic] Database indexer prints its status
- [Elastic][Fix] Database indexer skips projects with invalid HEAD reference
- [Elastic] More efficient snippets search
- [Elastic] Add rake task for removing all indexes
- [Elastic] Add rake task for clearing indexing status
- Set KRB5 as default clone protocol when Kerberos is enabled and user is logged in (Borja Aparicio)
v 8.7.2
......
......@@ -103,11 +103,15 @@ namespace :gitlab do
klass = model_name.constantize
klass.__elasticsearch__.create_index! force: true
print "Reindexing #{klass} records... "
if klass == Note
Note.searchable.import
else
klass.import
end
puts "done".green
end
desc "GitLab | Create empty Elasticsearch indexes"
......@@ -122,7 +126,37 @@ namespace :gitlab do
ProjectWiki,
Repository
].each do |klass|
print "Creating index for #{klass}... "
klass.__elasticsearch__.create_index!
puts "done".green
end
end
desc "GitLab | Clear Elasticsearch indexing status"
task clear_index_status: :environment do
IndexStatus.destroy_all
puts "Done".green
end
desc "GitLab | Delete Elasticsearch indexes"
task delete_indexes: :environment do
[
Project,
Issue,
MergeRequest,
Snippet,
Note,
Milestone,
ProjectWiki,
Repository
].each do |klass|
print "Delete index for #{klass}... "
klass.__elasticsearch__.delete_index!
puts "done".green
end
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment