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, 22 Aug 2008

view this page in

SwishSearch->execute

(No version information available, might be only in CVS)

SwishSearch->executeExecute the search and get the results

Descripción

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

Esta función es EXPERIMENTAL. Esto significa que el comportamiento de esta función, el nombre de esta función y en definitiva TODO lo documentado sobre esta función, puede cambiar en una futura version de PHP SIN AVISO. La advertencia queda hecha, y utilizar esta extensión queda bajo su propia responsabilidad.

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

Lista de parámetros

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.

Valores retornados

Returns SwishResults object.

Errors/Exceptions

Throws SwishException on error.

Ejemplos

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

?>

El resultado del ejemplo seria algo similar 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, 22 Aug 2008
 
 
show source | credits | sitemap | contact | advertising | mirror sites