Index options not available in search_api settings

Created on 22 April 2020, over 4 years ago
Updated 1 August 2024, 4 months ago

When creating an index from elasticsearch_connector settings "/admin/config/search/elasticsearch-connector/index/add" it allows to select a number of shards and replicas, but when you clear index from search_api settings, it automatically recreates new index but without this settings.

In code, it trying to get option from Index entity, but it's instance of "\Drupal\search_api\IndexInterface":

<?php
   public static function create(IndexInterface $index) {
     $indexName = static::getIndexName($index);
     $indexConfig =  [
       'index' => $indexName,
       'body' => [
         'settings' => [
           'number_of_shards' => $index->getOption('number_of_shards', 5),
           'number_of_replicas' => $index->getOption('number_of_replicas', 1),
         ],
       ],
     ];
?>

Proposed solution is to duplicate shards and replicas to search_api index settings.

πŸ› Bug report
Status

RTBC

Version

7.0

Component

Elasticsearch Connector

Created by

πŸ‡ΊπŸ‡¦Ukraine zviryatko

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024