Skip to content

Commit c0b643a

Browse files
authored
Fix resetIndexType on ES 1.x
In version 1 of ES, the settings are different. Also the number_of_replicas cannot be changed on closed indexed as well: > Can't update [index.number_of_replicas] on closed indices [] - can leave index in an unopenable state
1 parent 70ea4d0 commit c0b643a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Index/Resetter.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,8 @@ public function resetIndexType($indexName, $typeName)
136136
}
137137

138138
if (!empty($settings)) {
139-
unset($settings['number_of_shards']);
139+
unset($settings['number_of_shards'], $settings['index']['number_of_shards']);
140+
unset($settings['number_of_replicas'], $settings['index']['number_of_replicas']);
140141
$index->close();
141142
$index->setSettings($settings);
142143
$index->open();

0 commit comments

Comments
 (0)