PECL中的clucene库

 
getMessage() . ‘, ‘;
echo ‘File: ‘ . $e->getFile() . ‘, ‘;
echo ‘Line: ‘ . $e->getLine();
exit();
}
$query = ”;
if (isset($_SERVER['argv'][1])) {
$query = $_SERVER['argv'][1];
} else {
$query = “time”; /* Should return 3 results */
}
echo “Search results for: ‘$query’\n”;
$hits = $searcher->search($query);
$length = $hits->length();
echo “Number of results: $length\n”;
for ($i = 0; $i < $length; $i++) {
echo 'path: ' . $hits->get($i, ‘path’) . “, “;
echo ‘id: ‘ . $hits->id($i) . “, “;
echo ‘score: ‘ . round($hits->score($i), 3) . “\n”;
}
/* Optional */
$searcher->close();
?>

http://pecl.php.net/packages.php
http://pecl.php.net/package/clucene

发表评论

电子邮件地址不会被公开。 必填项已用*标注