Hola amigos, leí este toturial:
http://www.phpriot.com/articles/zend-search-lucene/7
Y lo probé, me descargé el Zend Framework, y todo...
Creo el script llamado find.php:
Código php:
Ver original<?php
require_once '/var/www/Zend/Search/Lucene.php';
$query = 'php';
$query1 = 'php';
$index = Zend_Search_Lucene::open("/nutch/crawl");
$results = $index->find($query);
echo "Index contains ".$index->count()." documents.\n\n";
{
$count = 0;
foreach ($results as $result)
{
$data[$count]["article_url"] = $result->url;
$data[$count]["article_title"] = $query->highlightMatches($result->title);
$data[$count]["article_description"] = $query->highlightMatches($result->contents);
$data[$count]["article_created_date_time"] = $result->postedDateTime;
$data[$count]["article_id"] = $result->articleId;
$count++;
}
}
?>
y me da este error:
Cita: Fatal error: Uncaught exception 'Zend_Search_Lucene_Exception' with message 'fopen(/nutch/crawl/read.lock.file) [<a href='function.fopen'>function.fopen</a>]: failed to open stream: Permission denied' in /var/www/Zend/Search/Lucene/Storage/File/Filesystem.php:69 Stack trace: #0 /var/www/Zend/Search/Lucene/Storage/Directory/Filesystem.php(185): Zend_Search_Lucene_Storage_File_Filesystem->__construct('/nutch/crawl/re...', 'w+b') #1 /var/www/Zend/Search/Lucene/LockManager.php(138): Zend_Search_Lucene_Storage_Directory_Filesystem->createFile('read.lock.file') #2 /var/www/Zend/Search/Lucene.php(485): Zend_Search_Lucene_LockManager::obtainReadLock(Obj ect(Zend_Search_Lucene_Storage_Directory_Filesyste m)) #3 /var/www/Zend/Search/Lucene.php(196): Zend_Search_Lucene->__construct('/nutch/crawl', false) #4 /var/www/find.php(5): Zend_Search_Lucene::open('/nutch/crawl') #5 {main} thrown in /var/www/Zend/Search/Lucene/Storage/File/Filesystem.php on line 69
Como lo puedo solucionar?