/**
* @group functional
*/
public function testAggregateWithLimitedSource()
{
$aggr = new TopHits('top_tag_hits');
$aggr->setSource(array('title'));
$resultDocs = array();
$outerAggrResult = $this->getOuterAggregationResult($aggr);
foreach ($outerAggrResult['buckets'] as $bucket) {
foreach ($bucket['top_tag_hits']['hits']['hits'] as $doc) {
$this->assertArrayHasKey('title', $doc['_source']);
$this->assertArrayNotHasKey('tags', $doc['_source']);
$this->assertArrayNotHasKey('last_activity_date', $doc['_source']);
}
}
}