Clear the index status when reindexing a project via gitlab:elastic:index_projects
Problem to solve
One our documentation, we suggested to re-index a project if we can't get any hits for the search term in the UI.
However, this won't always work if the IndexStatus
record is updated for a specific project.
Proposal
Clear the index status within the rake task. This was suggested by @dgruzd in the slack thread.
Implementation plan
- modify the
elastic.rake
taskindex_projects
to clearIndexStatus
record from each project - add a line before the
::Elastic::ProcessInitialBookkeepingService.backfill_projects!
line that deletes the records for the current batch of IDs. It is important to clear the records before queueing the projects up for indexing.
IndexStatus.for_project(ids).delete_all
::Elastic::ProcessInitialBookkeepingService.backfill_projects!(*Project.find(ids))
- add a new test to elastic_rake_spec.rb to verify that the records get deleted
Intended users
This page may contain information related to upcoming products, features and functionality. It is important to note that the information presented is for informational purposes only, so please do not rely on the information for purchasing or planning purposes. Just like with all projects, the items mentioned on the page are subject to change or delay, and the development, release, and timing of any products, features, or functionality remain at the sole discretion of GitLab Inc.