Skip to content

Commit

Permalink
Ability to change mapping filename (#120)
Browse files Browse the repository at this point in the history
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']);
```
  • Loading branch information
insekticid committed Oct 9, 2022
1 parent a116efb commit cabc799
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/IndexBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit cabc799

Please sign in to comment.