/**
* @group functional
*/
public function testAggregateWithHighlight()
{
$queryString = new SimpleQueryString('linux', array('title'));
$aggr = new TopHits('top_tag_hits');
$aggr->setHighlight(array('fields' => array('title' => new \stdClass())));
$query = new Query($queryString);
$query->addAggregation($aggr);
$resultSet = $this->_getIndexForTest()->search($query);
$aggrResult = $resultSet->getAggregation('top_tag_hits');
foreach ($aggrResult['hits']['hits'] as $doc) {
$this->assertArrayHasKey('highlight', $doc);
$this->assertRegExp('#<em>linux</em>#', $doc['highlight']['title'][0]);
}
}