diff --git a/CHANGELOG-6.0.md b/CHANGELOG-6.0.md index 5608d6d6c..ccbe2b362 100644 --- a/CHANGELOG-6.0.md +++ b/CHANGELOG-6.0.md @@ -11,6 +11,7 @@ in 6.0 versions. * **[BC break]** Marked the `fos_elastica.client_prototype` service as private. * **[BC break]** Marked the `fos_elastica.index_template_prototype` service as private. * Added `auth_type` client parameter [Elastica#1790](https://github.com/ruflin/Elastica/pull/1790). +* Fixed deprecations for `Elastica\Index::create()` [Elastica#1828](https://github.com/ruflin/Elastica/pull/1828). ### 6.0.0-BETA3 (2020-09-28) diff --git a/src/Command/CreateCommand.php b/src/Command/CreateCommand.php index 32ddcd90d..de76adb19 100644 --- a/src/Command/CreateCommand.php +++ b/src/Command/CreateCommand.php @@ -68,7 +68,7 @@ protected function execute(InputInterface $input, OutputInterface $output) $this->aliasProcessor->setRootName($indexConfig, $index); } $mapping = $this->mappingBuilder->buildIndexMapping($indexConfig); - $index->create($mapping, false); + $index->create($mapping); if ($indexConfig->isUseAlias()) { $index->addAlias($indexName); diff --git a/src/Index/Resetter.php b/src/Index/Resetter.php index ffec01e5a..594f5a961 100644 --- a/src/Index/Resetter.php +++ b/src/Index/Resetter.php @@ -88,7 +88,7 @@ public function resetIndex(string $indexName, bool $populating = false, bool $fo $this->dispatcher->dispatch($event = new PreIndexResetEvent($indexName, $populating, $force)); $mapping = $this->mappingBuilder->buildIndexMapping($indexConfig); - $index->create($mapping, true); + $index->create($mapping, ['recreate' => true]); if (!$populating and $indexConfig->isUseAlias()) { $this->aliasProcessor->switchIndexAlias($indexConfig, $index, $force);