/**
* @group functional
*/
public function testAggregateWithExplain()
{
$aggr = new TopHits('top_tag_hits');
$aggr->setExplain(true);
$resultDocs = array();
$outerAggrResult = $this->getOuterAggregationResult($aggr);
foreach ($outerAggrResult['buckets'] as $bucket) {
foreach ($bucket['top_tag_hits']['hits']['hits'] as $doc) {
$this->assertArrayHasKey('_explanation', $doc);
}
}
}