searchable = $searchable; $this->query = $query; } /** * Returns the paginated results. * * @return Elastica_ResultSet */ protected function getElasticaResults($offset, $itemCountPerPage) { $query = clone $this->query; $query->setFrom($offset); $query->setLimit($itemCountPerPage); return $this->searchable->search($query); } /** * Returns the paginated results. * * @return FOQ\ElasticaBundle\Paginator\PartialResultInterface */ public function getResults($offset, $itemCountPerPage) { return new RawPartialResults($this->getElasticaResults($offset,$itemCountPerPage)); } /** * Returns the number of results. * * @return integer The number of results. */ public function getTotalHits() { return $this->searchable->count($this->query); } }