Example #1
0
function fill_index()
{
    for ($i = 0; $i < 10; $i++) {
        $index = new Zend_Search_Lucene('./data/index', true);
        $index->find("test");
        $doc = new Zend_Search_Lucene_Document();
        $doc->addField(Zend_Search_Lucene_Field::Text("test", getword()));
        $doc->addField(Zend_Search_Lucene_Field::UnStored("contents", getword()));
        $index->addDocument($doc);
        $index->commit();
        $index->getDirectory()->close();
        //comment this to see another bug :-|
    }
}