Smile\ElasticsuiteCore\Search\Adapter\Elasticsuite\Response\QueryResponse::prepareDocuments PHP Method

prepareDocuments() private method

Build document list from the engine raw search response.
private prepareDocuments ( array $searchResponse, DocumentFactory $documentFactory ) : void
$searchResponse array Engine raw search response.
$documentFactory DocumentFactory Document factory
return void
    private function prepareDocuments(array $searchResponse, DocumentFactory $documentFactory)
    {
        $this->documents = [];
        if (isset($searchResponse['hits'])) {
            $hits = $searchResponse['hits']['hits'];
            foreach ($hits as $hit) {
                $this->documents[] = $documentFactory->create($hit);
            }
            $this->count = $searchResponse['hits']['total'];
        }
    }