api/MarkLogic/MLPHP/Search.php
public function retrieve($query, $params = array(), $structured = false)
    {
        $this->query = (string)$query;
        $params = array_merge(array(($structured ? 'structuredQuery' : 'q') =>
            $this->query), $this->getParams(), $params);
        $request = new RESTRequest('GET', 'search', $params);

        try {
            $response = $this->client->send($request);
            //print_r($response);
            $results = new SearchResults($response->getBody());
            return $results;
        } catch(Exception $e) {
            echo $e->getMessage() . ' in ' . $e->getFile() .
                ' on line ' . $e->getLine() . PHP_EOL;
        }
    }
public function retrieve($query, $params = array(), $structured = false)
    {
        $this->query = (string)$query;
        $params = array_merge(array(($structured ? 'structuredQuery' : 'q') =>
            $this->query), $this->getParams(), $params);
        $request = new RESTRequest('GET', 'search', $params);

        try {
            $response = $this->client->send($request);
            //print_r($response);
            $results = new SearchResults($response->getBody());
            return $results;
        } catch(Exception $e) {
            echo $e->getMessage() . ' in ' . $e->getFile() .
                ' on line ' . $e->getLine() . PHP_EOL;
        }
    }
Retrieve the search results using the REST client.

@param string $query The search query.
@param array $params
@param bool $structured defaults to false
@return SearchResults A search results object.