SwishSearch->execute
(no version information, might be only in CVS)
SwishSearch->execute -- Execute the search and get the results
Beskrivelse
object
SwishSearch->execute ( [string query] )
Advarsel |
Denne funktion er
EKSPERIMENTABEL. Virkemåden af denne funktion,
navnet på funktionen, og andet ellers dokumenteret om denne
funktion, ændres muligvis uden advarsel i en fremtidig version af PHP.
Brug af denne funktion er på ejet ansvar. |
Searches the index file(s) based on the parameters set in the search
object.
Parameterliste
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.
Returneringsværdier
Returns SwishResults object.
Errors/Exceptions
Throws SwishException on error.
Eksempler
Eksempel 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"; }
?>
|
Ovenstående eksempel vil udskrive
noget der ligner: First query found: 2 hits
Second query found: 12 hits |
|