From cabc7995231aeeb0718b0b1f16039ca9cdb63f47 Mon Sep 17 00:00:00 2001 From: "Exploit.cz" Date: Sun, 9 Oct 2022 12:50:31 +0200 Subject: [PATCH] Ability to change mapping filename (#120) if using non standardized mapping file naming ```php //this will work $indexBuilder->migrate($this->elasticallyClient->getIndex($indexName), [], ['filename' => 'content_mapping.yaml']); //this works $index = $indexBuilder->createIndex($indexName, ['filename' => 'content_mapping.yaml']); ``` --- src/IndexBuilder.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/IndexBuilder.php b/src/IndexBuilder.php index 4945b95..33a461d 100644 --- a/src/IndexBuilder.php +++ b/src/IndexBuilder.php @@ -70,10 +70,10 @@ public function speedUpRefresh(Index $index): void $index->getSettings()->setRefreshInterval('1s'); } - public function migrate(Index $currentIndex, array $params = []): Index + public function migrate(Index $currentIndex, array $params = [], array $context = []): Index { $pureIndexName = $this->indexNameMapper->getPureIndexName($currentIndex->getName()); - $newIndex = $this->createIndex($pureIndexName); + $newIndex = $this->createIndex($pureIndexName, $context); $reindex = new Reindex($currentIndex, $newIndex, $params); $reindex->setWaitForCompletion(false);