You are here

public function SearchApiElasticsearchElastica::filterSettings in Search API Elasticsearch 7

Get settings.

1 call to SearchApiElasticsearchElastica::filterSettings()
SearchApiElasticsearchElastica::getSettings in modules/elastica/includes/SearchApiElasticsearchElastica.inc
Get settings.

File

modules/elastica/includes/SearchApiElasticsearchElastica.inc, line 857
Provides Elastica client for Search API Elasticsearch.

Class

SearchApiElasticsearchElastica
Search API Elasticsearch Elastica service class.

Code

public function filterSettings($settings) {
  $new_settings = array();
  foreach ($settings as $setting => $value) {
    $filtered_setting = str_replace('index.', '', $setting);
    $new_settings[$filtered_setting] = $value;
  }
  foreach ($new_settings as $new_setting => $new_settings_value) {
    if (in_array($new_setting, array(
      'number_of_shards',
      'number_of_replicas',
    ))) {
      unset($new_settings[$new_setting]);
    }
  }
  return $new_settings;
}