- Issue created by @thebrokenbrain
- Merge request !1063530738: Let users configure shards and replicas vĂa UI â (Open) created by Unnamed author
Currently, when an index is created using the Search API OpenSearch module, the number of shards and replicas is set using default OpenSearch values. These settings can significantly impact performance, resilience, and storage usage, especially in larger or more complex deployments.
There is no way to configure the number of shards and replicas from the administrative UI, which forces developers to override this via external index management.
Allowing these values to be configurable through the Drupal UI would give site administrators more control over the indexing behavior and make the module more flexible in production scenarios.
1. Install and enable the search_api_opensearch module.
2. Create a new Search API index using the OpenSearch backend.
3. Observe that there is no option to set the number of shards or replicas in the configuration form.
4. The index is created with default OpenSearch settings (usually 1 shard and 1 replica).
Add two new configuration fields to the OpenSearch index configuration form:
- Number of shards
- Number of replicas
These settings should be passed to OpenSearch when the index is created via the API, using the appropriate OpenSearch index settings.
Defaults can be provided (e.g., 1 shard, 1 replica), but the user should be able to override them via the UI.
Update the code that creates the OpenSearch index to include number_of_shards and number_of_replicas settings.
Two new number fields in the OpenSearch backend configuration form:
- Number of shards
- Number of replicas
Active
2.4
Code