@bl4ckb1rd: Še tole, v ozadju moraš indekser nafilat in sicer:
// indexer se zna obesit zato k ma premal rama, dajmo mu ga več
set_time_limit(100);
ini_set('memory_limit','64M');
require_once 'Zend/Search/Lucene.php';
//RM: CaseInsensitive is used, check http://framework.zend.com/manual/en/zend.search.lucene.charset.html for more info
Zend_Search_Lucene_Analysis_Analyzer::setDefault(new Zend_Search_Lucene_Analysis_Analyzer_Common_Utf8_CaseInsensitive());
self::$works = Application::indexWorks();
$indexDir = Application::getIndexPath();
try {
$index = Zend_Search_Lucene::open($indexDir);
} catch (Zend_Search_Lucene_Exception $e) {
$index = Zend_Search_Lucene::create($indexDir);
}
$doc = new Zend_Search_Lucene_Document();
$encoding = 'utf-8';
$id = 'content'.$id;
$doc->addField(Zend_Search_Lucene_Field::UnIndexed(self::F_CREATED, time()));
$doc->addField(Zend_Search_Lucene_Field::Keyword(self::F_AREA, $area, $encoding));
$doc->addField(Zend_Search_Lucene_Field::Keyword(self::F_ID, $area . $id, $encoding));
$doc->addField(Zend_Search_Lucene_Field::Keyword(self::F_LANG, $lang, $encoding));
$doc->addField(Zend_Search_Lucene_Field::Text(self::F_TITLE, $title, $encoding));
$doc->addField(Zend_Search_Lucene_Field::Text(self::F_URL, $url, $encoding));
$doc->addField(Zend_Search_Lucene_Field::Text(self::F_DESCRIPTION, $description, $encoding));
$doc->addField(Zend_Search_Lucene_Field::UnStored(self::F_CONTENT, $content, $encoding));
$doc->addField(Zend_Search_Lucene_Field::Text(self::F_PORTAL, $portal, $encoding));
$index->addDocument($doc);
P.S: Priporočam ti, da vsakič, ko gradiš nov index vedno pobriši celoten index in na novo dodaj. Meni se zdi, da veliko hitreje dela + več zadetkov meče, kot če editaš zadeve.