searchable = $searchable; $this->query = $query; } protected function getElasticaResults($offset, $itemCountPerPage) { $query = clone $this->query; $query->setFrom($offset); $query->setLimit($itemCountPerPage); return $this->searchable->search($query)->getResults(); } /** * @see Zend\Paginator\Adapter::count */ public function count() { return $this->searchable->count($this->query); } }