public function testSearchMultipleIndexes()
{
$client = \ElasticSearch\Client::connection();
$tag = $this->getTag();
$primaryIndex = 'test-index';
$secondaryIndex = 'test-index2';
$doc = array('title' => $tag);
$options = array('refresh' => true);
$client->setIndex($secondaryIndex)->index($doc, false, $options);
$client->setIndex($primaryIndex)->index($doc, false, $options);
$indexes = array($primaryIndex, $secondaryIndex);
// Use both indexes when searching
$resp = $client->setIndex($indexes)->search("title:{$tag}");
$this->assert->array($resp)->hasKey('hits')->array($resp['hits'])->hasKey('total')->integer($resp['hits']['total'])->isEqualTo(2);
$client->delete();
}