add settings in BackendClient->addIndex

Created on 19 March 2025, about 2 months ago

Problem/Motivation

static settings cannot be added/modified after index creation in opensearch 2.19

in my particular use case index.knn can not be set to true.

See https://opensearch.org/docs/latest/vector-search/settings/#index-settings

Steps to reproduce

### Update settings.
PUT http://localhost:9200/local_cross_site_index_a/_settings
Accept: application/json
content-type: application/json; charset=UTF-8

{
	"index": {
		"knn": "true"
	}
}

~~~

HTTP/1.1 400 Bad Request
content-type: application/json; charset=UTF-8
content-encoding: gzip
content-length: 153

{
  "error": {
    "root_cause": [
      {
        "type": "illegal_argument_exception",
        "reason": "final local_cross_site_index_a setting [index.knn], not updateable"
      }
    ],
    "type": "illegal_argument_exception",
    "reason": "final local_cross_site_index_a setting [index.knn], not updateable"
  },
  "status": 400
}

Proposed resolution

add new "IndexCreateEvent" event to addIndex function that allows arbitrary body to be added to:

      $this->client->indices()->create([
        'index' => $indexId,
      ]);

Remaining tasks

Write event
Integrate event into BackendClient

User interface changes

NA

API changes

  /**
   * {@inheritdoc}
   */
  public static function getSubscribedEvents() {
    return [
      IndexCreateEvent::class => ['onIndexCreate'],

Data model changes

NA

✨ Feature request
Status

Active

Version

3.0

Component

Code

Created by

πŸ‡¦πŸ‡ΊAustralia rakugaki Sydney

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024