Skip to content

Commit

Permalink
Merge pull request #26 from ttreeagency/dfeyer-patch-1
Browse files Browse the repository at this point in the history
BUGFIX: Mapping update work on the production indexes
  • Loading branch information
dfeyer authored Feb 2, 2018
2 parents 625bbce + 6f55b1a commit 0db2751
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public function buildCommand($workspace = null)
{
$indexPostfix = time();
$indexName = $this->createNextIndex($indexPostfix);
$this->updateMapping();
$this->updateMapping($indexPostfix);

$this->outputLine();
$this->outputLine('<b>Indexing on %s ...</b>', [$indexName]);
Expand Down Expand Up @@ -255,10 +255,11 @@ protected function createNextIndex($indexPostfix)
/**
* Update Index Mapping
*/
protected function updateMapping()
protected function updateMapping($indexPostfix)
{
$nodeTypeMappingCollection = $this->nodeTypeMappingBuilder->buildMappingInformation($this->nodeIndexer->getIndex());
foreach ($nodeTypeMappingCollection as $mapping) {
$this->nodeIndexer->setIndexNamePostfix($indexPostfix);
/** @var Mapping $mapping */
$mapping->apply();
}
Expand Down

0 comments on commit 0db2751

Please sign in to comment.