/**
  * Create Query Response instance
  *
  * @param mixed $rawResponse
  * @return QueryResponse
  */
 public function create($rawResponse)
 {
     $rawResponse = $this->prepareData($rawResponse);
     $documents = array();
     foreach ($rawResponse['documents'] as $rawDocument) {
         /** @var \Magento\Framework\Search\Document[] $documents */
         $documents[] = $this->documentFactory->create($rawDocument);
     }
     /** @var \Magento\Framework\Search\Aggregation $aggregations */
     $aggregations = $this->aggregationFactory->create($rawResponse['aggregations']);
     return $this->objectManager->create('\\Magento\\Framework\\Search\\QueryResponse', ['documents' => $documents, 'aggregations' => $aggregations]);
 }
 /**
  * {@inheritDoc}
  */
 public function create(array $rawAggregation)
 {
     $aggregations = $this->preprocessAggregations($rawAggregation);
     return parent::create($aggregations);
 }