SwishSearch::execute

(PECL swish >= 0.1.0)

SwishSearch::executeExecute the search and get the results

说锟斤拷

SwishSearch::execute ([ string $query ] ) : object
Warning

锟剿猴拷锟斤拷锟斤拷实锟斤拷锟斤拷锟侥★拷锟剿猴拷锟斤拷锟侥憋拷锟襟,帮拷锟斤拷锟斤拷锟狡硷拷锟斤拷锟斤拷锟斤拷牡锟斤拷锟斤拷锟斤拷锟斤拷锟轿达拷锟斤拷锟� PHP 锟斤拷锟斤拷锟芥本锟斤拷未通知锟酵憋拷锟睫改★拷使锟矫憋拷锟斤拷锟斤拷锟斤拷锟斤拷锟皆碉拷 锟斤拷

Searches the index file(s) based on the parameters set in the search object.

锟斤拷锟斤拷

query

The query string is an optional parameter, it can be also set using Swish::prepare() method. The query string is preserved between executions, so you can set it once, but execute the search multiple times.

锟斤拷锟斤拷值

Returns SwishResults object.

锟斤拷锟斤拷锟届常

Throws SwishException on error.

锟斤拷锟斤拷

Example #1 Basic SwishSearch::execute() example

<?php

try {

    
$swish = new Swish("index.swish-e");
    
$search $swish->prepare();

    
$results $search->execute("query");
    echo 
"First query found: "$results->hits" hits\n";

    
$results $search->execute("new OR query");
    echo 
"Second query found: "$results->hits" hits\n";

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

?>

锟斤拷锟斤拷锟斤拷锟教碉拷锟斤拷锟斤拷锟斤拷锟斤拷冢锟�

First query found: 2 hits
Second query found: 12 hits