Deprecate namespace_ancestry_ids field & migrate to traversal_ids
Background
When namespace_ancestry_ids
was first introduced to Elasticsearch as a mapped field, the traversal_ids
feature was not fully completed or rolled out. Since then, the common term used in the Rails codebase is traversal_ids
so we should move our existing documents to use that.
Proposal
For each index (issues and users) using namespace_ancestry_ids
field, do the following steps:
- create an advanced search migration to add a field alias of
traversal_ids
for the existingnamespace_ancestry_ids
field. Use the new field for searches only. Make sure the migration for adding the field alias is completed before using the new field - create advanced search migration(s) to add a new field and backfill the data (consider using painless scripting if possible)
- mark the field as
#deprecated
with a comment at the end of the field definition line in the config
Click to expand example
indexes :namespace_ancestry, type: :text, index_prefixes: { min_chars: 1, max_chars: 19 } # deprecated
- Use the new field for sending data and remove references to
namespace_ancestry_ids
from the codebase (when indexing), make sure the migration backfilling the data is completed before using the new field
Edited by Terri Chu