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 兼容性函数 get column information from a result and return as an objectphp dbx 函数 send a query and fetch all results if any php frontbase 函数 get column information from a result and return as an objectphp firebird/interbase 函数 execute a previously prepared queryphp firebird/interbase 函数 execute a query on an interbase databasephp informix 函数 return the content of a blob objectphp informix 函数 return the content of the char objectphp maxdb 函数 check if there any more query results from a multi queryphp maxdb 函数 send the query and returnphp snmp 函数 return all objects including their respective object id within the specified onephp sqlite 函数 execute a query against a given database and returns an arrayphp sqlite 函数 execute a query that does not prefetch and buffer all dataphp 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 sdo 函数 return the namespace uri of the type for a data objectphp swish 函数 construct a swish objectphp swish 函数 execute a query and return results objectphp swish 函数 get an array of stopwords removed from the queryphp swish 函数 execute the search and get the results
关注编程学问公众号