Swish::query

(PECL swish >= 0.1.0)

Swish::queryExecute a query and return results object

说明

Swish::query ( string $query ) : object
Warning

此函数是实验性的。此函数的表象,包括名称及其相关文档都可能在未来的 PHP 发布版本中未通知就被修改。使用本函数风险自担 。

A quick method to execute a search with default parameters.

参数

query

Query string.

返回值

Returns SwishResults object.

错误/异常

Throws SwishException on error.

范例

Example #1 Basic Swish::query() example

<?php

try {

    
$swish = new Swish("index.swish-e");
    
$results $swish->query("test query");

    echo 
"Found: "$results->hits" hits\n";

} catch (
SwishException $e) {
    echo 
$e->getMessage(), "\n";
}

?>

以上例程的输出类似于:

Found: 1 hits

相关文章
php cubrid mysql 兼容性函数 fetch the next row and return it as an objectphp cubrid mysql 兼容性函数 perform a query without fetching the results into memoryphp firebird/interbase 函数 return the number of rows that were affected by the previous queryphp firebird/interbase 函数 return the number of parameters in a prepared queryphp firebird/interbase 函数 return information about a parameter in a prepared queryphp ingres 函数 execute a prepared queryphp maxdb 函数 check if there any more query results from a multi queryphp maxdb 函数 execute an sql queryphp oci8 函数 returns the next row from a query as an objectphp snmp 函数 return all objects including their respective object id within the specified onephp spl 函数 return the integer object handle for given objectphp stream 函数 return a bucket object from the brigade for operating onphp sdo das relational 函数 executes an sql query passed as a prepared statement with a list of values to substitute for placeholders and return the results as a normalised data graphphp sdo das relational 函数 executes a given sql query against a relational database and returns the results as a normalised data graphphp sdo 函数 return the name of the type for a data objectphp swish 函数 construct a swish objectphp swish 函数 prepare a search queryphp swish 函数 execute a query and return results objectphp swish 函数 execute the search and get the resultsphp swish 函数 set the structure flag in the search object
关注编程学问公众号