public function search(Query $query, $offset = 0, $limit = 10)
    {
        $this->query = $query;

        if (!empty($limit)) {
            $query->setRows($limit);
        }
        $query->setStart($offset);

        try {
            $response = $this->solr->getReadService()->search($query);
            if ($this->configuration->getLoggingQueryQueryString()) {
                $this->logger->log(SolrLogManager::INFO,
                    'Querying Solr, getting result',
                    [
                        'query string' => $query->getQuery(),
                        'query parameters' => $query->getRequestBuilder()->build($query)->getParams(),
                        'response' => json_decode($response->getRawResponse(), true)
                    ]
                );
            }
        }  catch (SolrCommunicationException $e) {
            if ($this->configuration->getLoggingExceptions()) {
                $this->logger->log(
                    SolrLogManager::ERROR,
                    'Exception while querying Solr',
                    [
                        'exception' => $e->__toString(),
                        'query' => (array)$query,
                        'offset' => $offset,
                        'limit' => $query->getRows()
                    ]
                );
            }

            throw $e;
        }

        $this->response = $response;

        return $this->response;
    }
public function search(Query $query, $offset = 0, $limit = 10)
    {
        $this->query = $query;

        if (!empty($limit)) {
            $query->setRows($limit);
        }
        $query->setStart($offset);

        try {
            $response = $this->solr->getReadService()->search($query);
            if ($this->configuration->getLoggingQueryQueryString()) {
                $this->logger->log(SolrLogManager::INFO,
                    'Querying Solr, getting result',
                    [
                        'query string' => $query->getQuery(),
                        'query parameters' => $query->getRequestBuilder()->build($query)->getParams(),
                        'response' => json_decode($response->getRawResponse(), true)
                    ]
                );
            }
        }  catch (SolrCommunicationException $e) {
            if ($this->configuration->getLoggingExceptions()) {
                $this->logger->log(
                    SolrLogManager::ERROR,
                    'Exception while querying Solr',
                    [
                        'exception' => $e->__toString(),
                        'query' => (array)$query,
                        'offset' => $offset,
                        'limit' => $query->getRows()
                    ]
                );
            }

            throw $e;
        }

        $this->response = $response;

        return $this->response;
    }
public function search ( Query $ query , $ offset = 0 , $ limit = 10 ) { $ this -> query = $ query ; if ( ! empty ( $ limit ) ) { $ query -> setRows ( $ limit ) ; } $ query -> setStart ( $ offset ) ; try { $ response = $ this -> solr -> getReadService ( ) -> search ( $ query ) ; if ( $ this -> configuration -> getLoggingQueryQueryString ( ) ) { $ this -> logger -> log ( SolrLogManager :: INFO , 'Querying Solr, getting result' , [ 'query string' => $ query -> getQuery ( ) , 'query parameters' => $ query -> getRequestBuilder ( ) -> build ( $ query ) -> getParams ( ) , 'response' => json_decode ( $ response -> getRawResponse ( ) , true ) ] ) ; } } catch ( SolrCommunicationException $ e ) { if ( $ this -> configuration -> getLoggingExceptions ( ) ) { $ this -> logger -> log ( SolrLogManager :: ERROR , 'Exception while querying Solr' , [ 'exception' => $ e -> __toString ( ) , 'query' => ( array ) $ query , 'offset' => $ offset , 'limit' => $ query -> getRows ( ) ] ) ; } throw $ e ; } $ this -> response = $ response ; return $ this -> response ; }
Executes a query against a Solr server.

1) Gets the query string
2) Conducts the actual search
3) Checks debug settings

@param Query $query The query with keywords, filters, and so on.
@param int $offset Result offset for pagination.
@param int $limit Maximum number of results to return. If set to NULL, this value is taken from the query object.
@return ResponseAdapter Solr response
@throws \Exception
Executes a query against a Solr server .