setVersion() public method

Returns a version for each search hit.
public setVersion ( boolean $version )
$version boolean
Example #1
0
 /**
  * @group functional
  */
 public function testAggregateWithVersion()
 {
     $aggr = new TopHits('top_tag_hits');
     $aggr->setVersion(true);
     $resultDocs = array();
     $outerAggrResult = $this->getOuterAggregationResult($aggr);
     foreach ($outerAggrResult['buckets'] as $bucket) {
         foreach ($bucket['top_tag_hits']['hits']['hits'] as $doc) {
             $this->assertArrayHasKey('_version', $doc);
         }
     }
 }