Add force option to the index API
What does this MR do and why?
This MR adds Force
argument to the indexing API. I believe it will be very useful for us. The latest example when we could've used it is gitlab-com/gl-infra/production#17105 (closed). Instead of deleting and then indexing, we could just use "Force": true
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
- Obtain the payload from the Rails console via
puts Gitlab::Search::Zoekt::Client.instance.send(:indexing_payload, Project.find(7)).merge(Force: true).to_json
- Send this payload to the indexer
curl -XPOST -d '<PAYLOAD>' -H 'Content-Type: application/json' http://127.0.0.1:6080/indexer/index
- Ensure that it reindexes the repository
Edited by Dmitry Gruzd