public function getSlice($offset, $length)
    {
        $query = clone $this->query;
        $query->offset = $offset;
        $query->limit = $length;
        $query->performCount = false;

        $searchResult = $this->filterService->filterLocations($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;
        }

        if (!isset($this->facets) && isset($searchResult->facets)) {
            $this->facets = $searchResult->facets;
        }

        $list = [];
        foreach ($searchResult->searchHits as $hit) {
            $list[] = $hit->valueObject;
        }

        return $list;
    }
public function getSlice($offset, $length)
    {
        $query = clone $this->query;
        $query->offset = $offset;
        $query->limit = $length;
        $query->performCount = false;

        $searchResult = $this->filterService->filterLocations($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;
        }

        if (!isset($this->facets) && isset($searchResult->facets)) {
            $this->facets = $searchResult->facets;
        }

        $list = [];
        foreach ($searchResult->searchHits as $hit) {
            $list[] = $hit->valueObject;
        }

        return $list;
    }
public function getSlice ( $ offset , $ length ) { $ query = clone $ this -> query ; $ query -> offset = $ offset ; $ query -> limit = $ length ; $ query -> performCount = false ; $ searchResult = $ this -> filterService -> filterLocations ( $ 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 ; } if ( ! isset ( $ this -> facets ) && isset ( $ searchResult -> facets ) ) { $ this -> facets = $ searchResult -> facets ; } $ list = [ ] ; foreach ( $ searchResult -> searchHits as $ hit ) { $ list [ ] = $ hit -> valueObject ; } return $ list ; }
Returns a slice of the results, as Site Location objects.

@param int $offset The offset
@param int $length The length

@return \Netgen\EzPlatformSiteApi\API\Values\Location[]
Returns a slice of the results as Site Location objects .