I've searched for many info on the internet, also tried many various suggestions, but nothing seems to work as I need. So here is the problem: I want to use Zend_Search_Lucene to perform search in database, but I've stuck at the very begining.. creating Index and getting Zend to work at all. Im on shared Hostgator host and using this php code to generate my index:
include ('/home/username/public_html/website/config.php');
$path = '/usr/local/Zend';
set_include_path(get_include_path() . PATH_SEPARATOR . $path);
require_once('Zend/Loader.php');
Zend_Loader::registerAutoload();
require_once ('Zend/Search/Lucene.php');
$index = Zend_Search_Lucene::create('/home/username/public_html/website/tmpbuild');
$con = mysql_connect("".$dbhost."","".$dbusername."","".$dbpass."");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("".$dbname."", $con);
$sql = ('SELECT * FROM rasti_failai');
while($eilute = mysql_fetch_array($sql))
{
$filenamesql = $eilute['failu_name'];
$dydissql = $eilute['dydis'];
$hostas = $eilute['hostas'];
$datasql = $eilute['data'];
$aprasymassql = $eilute['header'];
$titlesql = $eilute['aprasymas'];
$url = $eilute['url'];
$links = $eilute['links'];
$document = new Zend_Search_Lucene_Document ();
$document->addField(Zend_Search_Lucene_Field::unIndexed('ID', $eilute['ID']));
$document->addField(Zend_Search_Lucene_Field::Text('failu_name', $eilute['failu_name']));
$document->addField(Zend_Search_Lucene_Field::UnStored('dydis', $eilute['dydis']));
$document->addField(Zend_Search_Lucene_Field::UnStored('hostas', $eilute['hostas']));
$document->addField(Zend_Search_Lucene_Field::UnStored('header', $eilute['header']));
$document->addField(Zend_Search_Lucene_Field::UnStored('aprasymas', $eilute['aprasymas']));
$document->addField(Zend_Search_Lucene_Field::UnStored('url', $eilute['url']));
$index->addDocument($document); }
$index->commit();
echo $index->count() . " documents have been indexed.\n";
But it seems I can't get Zend framework to work, as Im getting this error:
Warning: require_once(Zend/Loader.php) [function.require-once]: failed to open stream: No such file or directory in /home/username/public_html/website/adminp/lucene.php on line 15
Fatal error: require_once() [function.require]: Failed opening required 'Zend/Loader.php' (include_path='.:/usr/lib/php:/usr/local/lib/php:/usr/local/Zend') in /home/username/public_html/website/adminp/lucene.php on line 15
My host has zend framework (tho I dont know exact version, but I think hostgator uses latest one, and Im using php5) installed, and support says its in /usr/local/Zend directory.