docs: Add documentation for elasticsearch_shards and elasticsearch_replicas
What does this MR do and why?
Documents the existing but undocumented elasticsearch_shards and elasticsearch_replicas parameters in the Application Settings API.
These parameters already support two update modes:
- Scalar values - Set the same number of shards/replicas for all Elasticsearch indices
- Object values - Set different values per index using index alias names as keys
This documentation addition:
- Adds
elasticsearch_shardsandelasticsearch_replicasto the API parameter table - Adds a new "Elasticsearch index settings" section with usage examples for both modes
- Documents the requirement that both parameters must be provided together when using per-index values
This is a documentation-only MR that complements !216396 which adds the elasticsearch_index_settings GET endpoint.
References
- Related issue: #571263
- Related MR (GET endpoint): !216396
- Implementation code:
ee/app/services/ee/application_settings/update_service.rb#L77-99
Screenshots or screen recordings
Not applicable - documentation only changes.
How to set up and validate locally
- Review the documentation changes in
doc/api/settings.md - Verify the curl examples are correct by testing against a local GDK instance:
# Update all indices at once curl --request PUT \ --header "PRIVATE-TOKEN: <token>" \ --header "Content-Type: application/json" \ --url "http://gdk.local:3000/api/v4/application/settings" \ --data '{"elasticsearch_shards": 5, "elasticsearch_replicas": 1}' # Update specific indices individually curl --request PUT \ --header "PRIVATE-TOKEN: <token>" \ --header "Content-Type: application/json" \ --url "http://gdk.local:3000/api/v4/application/settings" \ --data '{"elasticsearch_shards": {"gitlab-development": 5}, "elasticsearch_replicas": {"gitlab-development": 1}}' - Run the docs linter:
vale doc/api/settings.md
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
MR Checklist (@gerardo-navarro)
- Changelog entry added, if necessary
- Documentation created/updated via this MR
- Documentation reviewed by technical writer or follow-up review issue created
- Tests added for this feature/bug - N/A (docs only)
- Tested in all supported browsers - N/A (docs only)
- Conforms to the code review guidelines
- Conforms to the style guides
- Conforms to the javascript style guides - N/A
- Conforms to the database guides - N/A
- Conforms to the merge request performance guidelines - N/A
- Documentation follows GitLab docs style guide