private function _doExecute(Query $query)
    {
        $collection = $this->documentManager->getCollection($this->documentClass);

        if ($this->isScroll()) {
            $scroll = $collection->scroll($query);

            foreach ($scroll as $resultSet) {
                yield $resultSet;
            }
        } else {
            yield $collection->search($query);
        }
    }