Elastica\Search::addIndices PHP Méthode

addIndices() public méthode

Add array of indices at once.
public addIndices ( array $indices = [] )
$indices array
    public function addIndices(array $indices = [])
    {
        foreach ($indices as $index) {
            $this->addIndex($index);
        }
        return $this;
    }

Usage Example

Exemple #1
0
 /**
  * @group unit
  */
 public function testAddIndices()
 {
     $client = $this->_getClient();
     $search = new Search($client);
     $indices = array();
     $indices[] = $client->getIndex('elastica_test1');
     $indices[] = $client->getIndex('elastica_test2');
     $search->addIndices($indices);
     $this->assertEquals(2, count($search->getIndices()));
 }
All Usage Examples Of Elastica\Search::addIndices