public function query($query, $returnErr = false, $raw = false)
    {
        // Query String Parameters
        $options = $query->getOptionsArray();
        $options['s.role'] = $this->authedUser ? 'authenticated' : 'none';

        // Special case -- if user filtered down to newspapers AND excluded them,
        // we can't possibly have any results:
        if (isset($options['s.fvf']) && is_array($options['s.fvf'])
            && in_array('ContentType,Newspaper Article,true', $options['s.fvf'])
            && in_array('ContentType,Newspaper Article', $options['s.fvf'])
        ) {
            return array(
                'recordCount' => 0,
                'documents' => array()
            );
        }

        $this->debugPrint('Query: ' . print_r($options, true));

        try {
            $result = $this->call($options, 'search', 'GET', $raw);
        } catch (SerialsSolutions_Summon_Exception $e) {
            if ($returnErr) {
                return array(
                    'recordCount' => 0,
                    'documents' => array(),
                    'errors' => $e->getMessage()
                );
            } else {
                $this->handleFatalError($e);
            }
        }

        return $result;
    }
public function query($query, $returnErr = false, $raw = false)
    {
        // Query String Parameters
        $options = $query->getOptionsArray();
        $options['s.role'] = $this->authedUser ? 'authenticated' : 'none';

        // Special case -- if user filtered down to newspapers AND excluded them,
        // we can't possibly have any results:
        if (isset($options['s.fvf']) && is_array($options['s.fvf'])
            && in_array('ContentType,Newspaper Article,true', $options['s.fvf'])
            && in_array('ContentType,Newspaper Article', $options['s.fvf'])
        ) {
            return array(
                'recordCount' => 0,
                'documents' => array()
            );
        }

        $this->debugPrint('Query: ' . print_r($options, true));

        try {
            $result = $this->call($options, 'search', 'GET', $raw);
        } catch (SerialsSolutions_Summon_Exception $e) {
            if ($returnErr) {
                return array(
                    'recordCount' => 0,
                    'documents' => array(),
                    'errors' => $e->getMessage()
                );
            } else {
                $this->handleFatalError($e);
            }
        }

        return $result;
    }
public function query ( $ query , $ returnErr = false , $ raw = false ) { // Query String Parameters $ options = $ query -> getOptionsArray ( ) ; $ options [ 's.role' ] = $ this -> authedUser ? 'authenticated' : 'none' ; // Special case -- if user filtered down to newspapers AND excluded them, // we can't possibly have any results: if ( isset ( $ options [ 's.fvf' ] ) && is_array ( $ options [ 's.fvf' ] ) && in_array ( 'ContentType,Newspaper Article,true' , $ options [ 's.fvf' ] ) && in_array ( 'ContentType,Newspaper Article' , $ options [ 's.fvf' ] ) ) { return array ( 'recordCount' => 0 , 'documents' => array ( ) ) ; } $ this -> debugPrint ( 'Query: ' . print_r ( $ options , true ) ) ; try { $ result = $ this -> call ( $ options , 'search' , 'GET' , $ raw ) ; } catch ( SerialsSolutions_Summon_Exception $ e ) { if ( $ returnErr ) { return array ( 'recordCount' => 0 , 'documents' => array ( ) , 'errors' => $ e -> getMessage ( ) ) ; } else { $ this -> handleFatalError ( $ e ) ; } } return $ result ; }
Execute a search.

@param SerialsSolutions_Summon_Query $query     Query object
@param bool                          $returnErr On fatal error, should we fail
outright (false) or treat it as an empty result set with an error key set
(true)?
@param bool                          $raw       Return raw (true) or processed
(false) response?

@return array             An array of query results
Execute a search .