From 27385046cae6a560ca778b0f682fde7cb395494c Mon Sep 17 00:00:00 2001 From: Oleg Andreyev Date: Fri, 8 Aug 2014 09:29:30 +0300 Subject: [PATCH] changing AliasProcessor::setRootName, so to use "Y-m-d-His" instead of random string --- Index/AliasProcessor.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Index/AliasProcessor.php b/Index/AliasProcessor.php index 93877cd..6b7da75 100644 --- a/Index/AliasProcessor.php +++ b/Index/AliasProcessor.php @@ -26,7 +26,12 @@ class AliasProcessor */ public function setRootName(IndexConfig $indexConfig, Index $index) { - $index->overrideName(sprintf('%s_%s', $indexConfig->getElasticSearchName(), uniqid())); + $index->overrideName( + sprintf('%s_%s', + $indexConfig->getElasticSearchName(), + date('Y-m-d-His') + ) + ); } /** @@ -116,7 +121,9 @@ class AliasProcessor /** * Returns array of indexes which are mapped to given alias * + * @param Client $client * @param string $aliasName Alias name + * * @return array */ private function getAliasedIndexes(Client $client, $aliasName)