PHP
downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

SwishSearch->resetLimit> <SwishResults->seekResult
Last updated: Fri, 18 Jul 2008

view this page in

SwishSearch->execute

(PECL swish:0.1-0.3.0)

SwishSearch->execute — Execute the search and get the results

Descrizione

object SwishSearch->execute ([ string $query ] )
Avviso

Questa funzione è SPERIMENTALE. Ovvero, il comportamento di questa funzione, il nome di questa funzione, in definitiva tutto ciò che è documentato qui può cambiare nei futuri rilasci del PHP senza preavviso. Siete avvisati, l'uso di questa funzione è a vostro rischio.

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

Elenco dei parametri

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.

Valori restituiti

Returns SwishResults object.

Errori/Eccezioni

Throws SwishException on error.

Esempi

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";
}

?>

Il precedente esempio visualizzerà qualcosa simile a:

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



add a note add a note User Contributed Notes
SwishSearch->execute
There are no user contributed notes for this page.

SwishSearch->resetLimit> <SwishResults->seekResult
Last updated: Fri, 18 Jul 2008
 
 
show source | credits | stats | sitemap | contact | advertising | mirror sites