response() public method

Put response.
public response ( array $response )
$response array
 public function search(array $query)
 {
     if (empty($query['body']['query']) && empty($query['body']['filter'])) {
         $query['body']['query'] = ['match_all' => []];
     }
     $params = ['index' => $this->model->getIndex(), 'type' => $this->model->getType(), 'from' => Arr::get($query, 'from', 0), 'size' => Arr::get($query, 'size', 50), 'body' => $query['body']];
     $collection = new ElasticsearchCollection();
     $this->emitter->trigger(DALEvents::BEFORE_SEARCH, $params);
     $response = $this->client->search($params);
     $this->emitter->trigger(DALEvents::AFTER_SEARCH, $response);
     $collection->response($response);
     $from = (int) $params['from'];
     foreach ($response['hits']['hits'] as $hit) {
         $model = $this->model->createInstance();
         $model->_score = $hit['_score'];
         $model->_position = $from++;
         $model->_exist = true;
         $model->fillByResponse($hit);
         $model->fillByInnerHits($hit);
         $collection->put($model->getId(), $model);
     }
     return $collection;
 }