Add support for using aliases to allow hot swapping of indexes when populating
This commit is contained in:
parent
82e9809ceb
commit
3b1a756e6f
7 changed files with 176 additions and 6 deletions
28
DynamicIndex.php
Normal file
28
DynamicIndex.php
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
<?php
|
||||
|
||||
namespace FOS\ElasticaBundle;
|
||||
|
||||
use Elastica\Index;
|
||||
|
||||
/**
|
||||
* Elastica index capable of reassigning name dynamically
|
||||
*
|
||||
* @author Konstantin Tjuterev <kostik.lv@gmail.com>
|
||||
*/
|
||||
class DynamicIndex extends Index
|
||||
{
|
||||
/**
|
||||
* Reassign index name
|
||||
*
|
||||
* While it's technically a regular setter for name property, it's specifically named overrideName, but not setName
|
||||
* since it's used for a very specific case and normally should not be used
|
||||
*
|
||||
* @param string $name Index name
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function overrideName($name)
|
||||
{
|
||||
$this->_name = $name;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue