Classes/Eel/ElasticSearchQueryBuilder.php
public function fetch(): array
    {
        try {
            $timeBefore = microtime(true);
            $request = $this->request->getRequestAsJson();

            $response = $this->elasticSearchClient->getIndex()->request('GET', '/_search', [], $request);
            $timeAfterwards = microtime(true);

            $this->result = $response->getTreatedContent();
            $searchResult = $this->evaluateResult($this->result);

            $this->result['nodes'] = [];

            $this->logThisQuery && $this->logger->log(sprintf('Query Log (%s): %s -- execution time: %s ms -- Limit: %s -- Number of results returned: %s -- Total Results: %s', $this->logMessage, $request, (($timeAfterwards - $timeBefore) * 1000), $this->limit, count($searchResult->getHits()), $searchResult->getTotal()), LOG_DEBUG);

            if (count($searchResult->getHits()) > 0) {
                $this->result['nodes'] = $this->convertHitsToNodes($searchResult->getHits());
            }
        } catch (ApiException $exception) {
            $this->logger->logException($exception);
            $this->result['nodes'] = [];
        }

        return $this->result;
    }
public function fetch(): array
    {
        try {
            $timeBefore = microtime(true);
            $request = $this->request->getRequestAsJson();

            $response = $this->elasticSearchClient->getIndex()->request('GET', '/_search', [], $request);
            $timeAfterwards = microtime(true);

            $this->result = $response->getTreatedContent();
            $searchResult = $this->evaluateResult($this->result);

            $this->result['nodes'] = [];

            $this->logThisQuery && $this->logger->log(sprintf('Query Log (%s): %s -- execution time: %s ms -- Limit: %s -- Number of results returned: %s -- Total Results: %s', $this->logMessage, $request, (($timeAfterwards - $timeBefore) * 1000), $this->limit, count($searchResult->getHits()), $searchResult->getTotal()), LOG_DEBUG);

            if (count($searchResult->getHits()) > 0) {
                $this->result['nodes'] = $this->convertHitsToNodes($searchResult->getHits());
            }
        } catch (ApiException $exception) {
            $this->logger->logException($exception);
            $this->result['nodes'] = [];
        }

        return $this->result;
    }
public function fetch ( ) : array { try { $ timeBefore = microtime ( true ) ; $ request = $ this -> request -> getRequestAsJson ( ) ; $ response = $ this -> elasticSearchClient -> getIndex ( ) -> request ( 'GET' , '/_search' , [ ] , $ request ) ; $ timeAfterwards = microtime ( true ) ; $ this -> result = $ response -> getTreatedContent ( ) ; $ searchResult = $ this -> evaluateResult ( $ this -> result ) ; $ this -> result [ 'nodes' ] = [ ] ; $ this -> logThisQuery && $ this -> logger -> log ( sprintf ( 'Query Log (%s): %s -- execution time: %s ms -- Limit: %s -- Number of results returned: %s -- Total Results: %s' , $ this -> logMessage , $ request , ( ( $ timeAfterwards - $ timeBefore ) * 1000 ) , $ this -> limit , count ( $ searchResult -> getHits ( ) ) , $ searchResult -> getTotal ( ) ) , LOG_DEBUG ) ; if ( count ( $ searchResult -> getHits ( ) ) > 0 ) { $ this -> result [ 'nodes' ] = $ this -> convertHitsToNodes ( $ searchResult -> getHits ( ) ) ; } } catch ( ApiException $ exception ) { $ this -> logger -> logException ( $ exception ) ; $ this -> result [ 'nodes' ] = [ ] ; } return $ this -> result ; }
Execute the query and return the list of nodes as result.

This method is rather internal; just to be called from the ElasticSearchQueryResult. For the public API, please use execute()

@return array<\Neos\ContentRepository\Domain\Model\NodeInterface>
@throws \Flowpack\ElasticSearch\Exception
Execute the query and return the list of nodes as result .