Public function to run the pazpar2 query.
If the query string is empty, don’t do anything.

The results of the query are available via getResults() after this function returns.
328813
public function run()
    {
        if ($this->fullQueryString() !== '') {
            $this->startQuery();
            // Fetching results can take a while. Increase our time limit.
            $maximumTime = 60;
            set_time_limit($maximumTime + 5);

            while (($this->queryIsRunning) && (time() - $this->queryStartTime < $maximumTime)) {
                sleep(2);
                if ($this->queryIsDone()) {
                    break;
                }
            }

            $this->fetchResults();
        }
    }
108358
public function run()
    {
        $ch = curl_init();

        $query = '';
        if (!empty($this->parameters)) {
            $query = '?' . http_build_query ($this->parameters);
        }
        $this->query = $this->url . $query;
        if ($this->method == "GET") {
            curl_setopt($ch, CURLOPT_URL, $this->url . $query);
        } else {
            curl_setopt($ch, CURLOPT_URL, $this->url);
            curl_setopt($ch, CURLOPT_POST, 1);
            curl_setopt($ch, CURLOPT_POSTFIELDS, $query);
        }

        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

        foreach ($this->options as $key => $value)
        {
            curl_setopt($ch, $key, $value);
        }

        $this->response = curl_exec($ch);
        $this->curlInfo = curl_getinfo($ch);
        $this->curlError = curl_error($ch);
    }
793161
public function run()
	{
		$query = $this->buildQuery();

		// Execute the query.
		$rawResults = $this->searcher->getClient()->search($query);

		// Pass response to the class that will do something with it.
		$resultParser = $this->getResultParser();
		$resultParser->setRawResults($rawResults);

		return $resultParser;
	}
186937
def _get_query_result(query, raw_result, **kwargs):
        
        if raw_result:
            return query(**kwargs)
        if kwargs:
            return QueryResult(query, **kwargs)

        return query.result
1244409
public function query($query, $params = null, $fetchResult = false)
        {
            $this->checkConnection(true);
            $this->log('Query: ' . $query);

            if(!empty($params)) {
                $this->log('Params: ' . print_r($params, true));
            }
            $start =  microtime(true);

            if(empty($params)) {
                $res = $this->executeQuery($query);
            } else {
                $res = $this->executePreparedStatement($query, $params);
            }

            $end = microtime(true);
            $this->log("Execution time: " . ($end - $start) . " seconds");


            if($fetchResult) {
    	        $this->log('Num Rows: '.odbc_num_rows($res));
                $resutlSet = $this->getRows($res);
                odbc_free_result($res);
                $res = $resutlSet;
                $resultSet = null;
                $fetch = microtime(true);
                $this->log("Fetch time: " . ($fetch - $end) . " seconds");
            }
            return $res;
        }
661182
function gotResults(results) {
  results.JSONquery = JSON.stringify(results.query, null, 2);
  console.log('gotResults', results);
  updateResults(results);
}
869790
private function postProcessResults($post_query, $results, $meta) {
        if(is_null($post_query)) {
            return $results;
        }

        $ret = [];
        switch($post_query[0]) {
            // Join up all results with a given key:value.
            case Token::C_TRANS:
                $key = $post_query[1];

                $ret_map = [];
                foreach($results as $result) {
                    if(!array_key_exists($key, $result)) {
                        continue;
                    }

                    $value = $result[$key];
                    if(!array_key_exists($value, $ret_map)) {
                        $ret_map[$value] = [];
                    }
                    $ret_map[$value] = array_merge($ret_map[$value], $result);
                }

                $ret = array_values($ret_map);
                break;
            default:
                throw new Exception('Unexpected command');
        }

        // If we wanted a count, generate it now.
        if($meta['count']) {
            $ret = ['count' => count($ret)];
        }

        return $ret;
    }
541939
final public function execute($bound_input_params = null)
	{
		if (!is_array($bound_input_params) or empty($bound_input_params)) {
			$success = parent::execute();
		} else {
			$success = parent::execute($this->bindConversion($bound_input_params));
		}

		// Accumulative success of statement execution
		if (is_null($this->_success)) {
			// Success is not set, so it is the result of this execution
			$this->_success = $success;
		} else {
			// Success is already set, so it is `&=`d to `$success`
			// false &= true -> false
			// true &= false -> false
			// true &= true -> true
			$this->_success &= $this->_success;
		}
		return $this;
	}
534817
def excute_query(query, db=None, flags=None, use_sudo=False, **kwargs):
    """"""

    flags = flags or u''
    if db:
        flags = u"%s -d %s" % (flags, db)
    command = u'psql %s -c "%s"' % (flags, query)
    if use_sudo:
        sudo(command, user='postgres', **kwargs)
    else:
        run(command, **kwargs)
686562
public static function run($query, $params=array()) {
		
		$self = static::getInstance();
		
		$self->openConnection();
		
		$ret = NULL;
		
		try {
			
			// prepare query
			$stat = $self->handler->prepare($query);

			// bind parameters
			$stat->execute((array)$params);

			// count affected rows
			$affected = $stat->rowCount();
			
		} catch (\PDOException $e) {
			
			// logger
			$self->logParamQuery($query, 0, $params);
			
			switch ($e->getCode()) {
				
				// integrity constraint violation
				/*
				 case '23000':
					 $message = 'Database integrity constraint violation';
					 break;
				 */
				default:
					$message = $e->getMessage();
					break;
			}
			
			$self->addError($message);
			
			$affected = 0;
			
		} catch (\Exception $e) {
			
			// logger
			$self->logParamQuery($query, 0, $params);
			$self->addError($e->getMessage());
			$affected = 0;
			
		}
		
		$stat->closeCursor();
		$self->logParamQuery($query, $affected, $params);
		
		return $affected;
			
	}
999841
public function run( $handler = null )
	{
		if ( !is_null( $handler ) )
		{
			$this->handler( $handler );
		}
		
		// if there is a special fetch handler defined pass him all the 
		// needed parameters and retrive the results
		if ( !is_null( $this->fetch_handler ) )
		{
			$results = call_user_func_array( $this->fetch_handler, array(
				&$this
			));
		}
		// otherwise simply do the default select fetch
		else 
		{
			$results = $this->handler->fetch( $this->build(), $this->handler->builder()->parameters, $this->fetch_arguments );
		}
		
		// In case we should forward a key means using a value
		// from every result as array key.
		if ( $this->forward_key !== false )
		{
			$raw_results = $results;
			$results = array();
			
			if ( in_array( 'assoc', $this->fetch_arguments ) )
			{
				foreach( $raw_results as $result )
				{
					$results[$result[$this->forward_key]] = $result;
				}
			}
			else
			{
				foreach( $raw_results as $result )
				{
					$results[$result->{$this->forward_key}] = $result;
				}
			}
		}
		
		// Group the results by a value
		if ( $this->group_result !== false )
		{
			$raw_results = $results;
			$results = array();
			
			if ( in_array( 'assoc', $this->fetch_arguments ) )
			{
				foreach( $raw_results as $key => $result )
				{
					$results[$result[$this->group_result]][$key] = $result;
				}
			}
			else
			{
				foreach( $raw_results as $key => $result )
				{
					$results[$result->{$this->group_result}][$key] = $result;
				}
			}
		}
		
		// when the limit is 1 we are going to return the 
		// result directly
		if ( $this->limit === 1 )
		{
			return reset( $results );
		}
		
		return $results;
	}
534479
public function execute($params = null) {
		if ($params === null) {
			$params = [];
		}

		try {
			$this->stmt->execute($params);

			return new QueryResult($this->stmt, $this->pdo);
		} catch (PDOException $e) {
			throw $this->exAdapter->adapt($e, $this->stmt, $params);
		}
	}
289509
public function execute($input_parameters = null)
    {
        $debug = $this->pdo->getDebugSnapshot();
        $return = parent::execute($input_parameters);

        $sql = $this->getExecutedQueryString($input_parameters?$input_parameters:array());
        $this->pdo->log($sql, null, __METHOD__, $debug);
        $this->pdo->setLastExecutedQuery($sql);
        $this->pdo->incrementQueryCount();

        return $return;
    }
779766
public function runQueries()
    {
        if (empty($this->_reqs)) {
            $this->_error = 'no queries defined, issue AddQuery() first';

            return false;
        }

        // mbstring workaround
        $this->_MBPush();

        if (!($fp = $this->_Connect())) {
            $this->_MBPop();

            return false;
        }

        // send query, get response
        $nreqs = count($this->_reqs);
        $req = implode('', $this->_reqs);
        $len = 8 + strlen($req);
        $req = pack('nnNNN', SEARCHD_COMMAND_SEARCH, VER_COMMAND_SEARCH, $len, 0, $nreqs).$req; // add header

        if (!($this->_Send($fp, $req, $len + 8)) ||
            !($response = $this->_GetResponse($fp, VER_COMMAND_SEARCH))
        ) {
            $this->_MBPop();

            return false;
        }

        // query sent ok; we can reset reqs now
        $this->_reqs = array();

        // parse and return response
        return $this->_ParseSearchResponse($response, $nreqs);
    }
114212
public function onResultDone()
    {
        $this->instate = 0;
        $this->onResponse->executeOne($this, true);
        $this->resultRows = [];
        $this->resultFields = [];
        $this->checkFree();

        if ($this->pool->config->protologging->value) {
            Daemon::log(__METHOD__);
        }
    }
150240
def execute(self, query_string, params=None):
    
    cr = self.connection.cursor()
    logger.info("SQL: %s (%s)", query_string, params)
    self.last_query = (query_string, params)
    t0 = time.time()
    cr.execute(query_string, params or self.core.empty_params)
    ms = (time.time() - t0) * 1000
    logger.info("RUNTIME: %.2f ms", ms)
    self._update_cursor_stats(cr)
    return cr
1332839
public function execute($query, $params = []) : object
    {
        self::$queries[] = $query;
        self::$params[]  = $params;
        self::$numQueries++;

        if ($this->options['verbose']) {
            echo "<p>Num query = "
                . self::$numQueries
                . "</p><p>Query = </p><pre>"
                . htmlentities($query)
                . "</pre>"
                . (empty($params)
                    ? null
                    : "<p>Params:</p><pre>" . htmlentities(print_r($params, 1)) . "</pre>"
                );
        }

        return parent::execute($query, $params);
    }