/**
  * Constructor.
  *
  * @param Manager $manager
  * @param string  $filename
  * @param bool    $convertDocuments
  */
 public function __construct($manager, $filename, $convertDocuments = true)
 {
     $this->manager = $manager;
     $this->filename = $filename;
     $this->converter = $manager->getConverter();
     $this->convertDocuments = $convertDocuments;
 }
 /**
  * @param array   $rawData
  * @param Manager $manager
  * @param array   $scroll
  */
 public function __construct(array $rawData, Manager $manager, array $scroll = [])
 {
     $this->manager = $manager;
     $this->converter = $manager->getConverter();
     $this->managerConfig = $manager->getConfig();
     if (isset($scroll['_scroll_id']) && isset($scroll['duration'])) {
         $this->scrollId = $scroll['_scroll_id'];
         $this->scrollDuration = $scroll['duration'];
     }
     if (isset($rawData['aggregations'])) {
         $this->aggregations =& $rawData['aggregations'];
     }
     if (isset($rawData['hits']['hits'])) {
         $this->documents = $rawData['hits']['hits'];
     }
     if (isset($rawData['hits']['total'])) {
         $this->count = $rawData['hits']['total'];
     }
 }