Create Elasticsearch migration to update code index options
As discussed in gitlab-org/gitlab!96785 (comment 1119501226) it should be possible to reindex all code in a long-running migration that requires zero index pausing via the following steps:
- Introduce a new field like
blob.content_2_0with the new settings - Update searches to search both
blob.contentandblob.content_2_0 - Change our writes to set
blob.content_2_0and blank outblob.content. It would probably be too costly to set both - Ship a migration which does a reindex by query in batches to copy the content over and blank out the old field
- When the migration is finished we could deprecate the
blob.contentfield somehow but probably it will need to be in a major release for backwards compatibility