SwishResults::seekResult

(PECL swish >= 0.1.0)

SwishResults::seekResultSet current seek pointer to the given position

说锟斤拷

SwishResults::seekResult ( int $position ) : int
Warning

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

锟斤拷锟斤拷

position

Zero-based position number. Cannot be less than zero.

锟斤拷锟斤拷值

Returns new position value on success.

锟斤拷锟斤拷锟届常

Throws SwishException on error.

锟斤拷锟斤拷

Example #1 Basic SwishResults::seekResult() example

<?php

try {

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

    
$results $search->execute("lost");

    
var_dump($results->seekResult(0)); //this will succeed
    
var_dump($results->seekResult(100)); //this will fail

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

?>

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

int(0)
Error: No more results