mirror of
https://github.com/php/pecl-search_engine-swish.git
synced 2026-03-24 01:02:07 +01:00
22 lines
307 B
PHP
22 lines
307 B
PHP
<?php
|
|
|
|
$h = new Swish("index.swish-e");
|
|
|
|
$s = $h->prepare();
|
|
$s->setSort('swishrank desc');
|
|
|
|
$results = $s->execute("for");
|
|
|
|
echo "There are ", $results->hits, " hits\n";
|
|
while ($r = $results->nextResult()) {
|
|
printf("%s %d %s\n",
|
|
$r->swishdocpath,
|
|
$r->swishrank,
|
|
$r->name
|
|
);
|
|
};
|
|
|
|
echo "Done\n";
|
|
|
|
?>
|