Migration to adopt new routing format for wikis
What does this MR do and why?
This MR is using the new routing structure for the wiki's search. Now the wikis are having the routing key like this n_#{root_namespace_id}, so updating the ee/lib/elastic/latest/routing.rb to set the routing as n_#{id}.
The second thing is to write a migration to change the routing key for the older wikis.
There is also a need to disable the routing until this migration is not finished. Because until the migration is not finished wiki routing will have old and new structures together so better to disable the routing. And this is the reason I am including the migration changes with this MR so that migration gets finished asap and routing will get enabled again.
Screenshots or screen recordings
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
| Before | After | 
|---|---|
How to set up and validate locally
Make sure Elasticsearch is enabled
Validating that routing is disabled for wikis search:
Create some project wikis and perform a GlobalSearch for wikis. Check the ES query in the PerformanceBar that the query params do not have a routing field. Also, the search results are showing the correct results.
Validating the migration:
- Open the Rails console
bundle exec rails c- Run the following command
require_relative 'ee/elastic/migrate/20230720000000_reindex_wikis_to_fix_routing.rb' 
ReindexWikisToFixRouting.new(20230720000000).migrate- Check wikis on ES
curl -H 'Content-type: application/json' -XGET 'http://localhost:9200/gitlab-development-wikis/_search'- The schema_versionmust be2307
- All the wikis must have the routing should be n_#{root_namespace_id}Numbered steps to set up and validate the change are strongly suggested.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
- 
I have evaluated the MR acceptance checklist for this MR. 
Approximate time to completion
~ 20 hours
[1] pry(main)> number_of_containers = 48391
=> 48391
[2] pry(main)> throttle_delay = 5.minute
=> 5 minutes
[3] pry(main)> batch_size = 500
=> 200
[4] pry(main)> ((number_of_containers / batch_size) * throttle_delay) / 1.hour
=> 20Related to #336100 (closed)