public function getSlice($offset, $length)
{
$query = clone $this->query;
$query->offset = $offset;
$query->limit = $length;
$query->performCount = false;
$searchResult = $this->searchService->findContent($query);
// Set count for further use if returned by search engine despite !performCount (Solr, ES)
if (!isset($this->nbResults) && isset($searchResult->totalCount)) {
$this->nbResults = $searchResult->totalCount;
}
return $searchResult->searchHits;
}