Hey!.

I'm trying to make a massive re-index, but always I got an exception:

Fatal error: Ignoring exception from Zend_Search_Lucene::__destruct() while an 
exception is already active (Uncaught Zend_Search_Lucene_Exception in 
/usr/local/lib/fw/php/phpzend-1.6.2/library/Zend/Search/Lucene/Storage/File/Filesystem.php
 on line 59) in 
/home/jfalvarez/my_site/application/modules/admin/controllers/PagesController.php
 on line 769

If I look into the line 59 of Filesystem.php I got this:

throw new Zend_Search_Lucene_Exception('File \'' . $filename . '\' is not 
readable.');

This is what I'm doing:

foreach ( $arrPages AS $arrPage )
{
    $objLuceneIndex = Zend_Search_Lucene::open( $strFoldexIndexPath );

    $objLuceneDocument = new Zend_Search_Lucene_Document();

    $objQueryMultiTerm = new Zend_Search_Lucene_Search_Query_MultiTerm();

    $objQueryMultiTerm->addTerm( new Zend_Search_Lucene_Index_Term( "page_id", 
$arrPage["id"] ), true );

    $objLuceneQueryHits = $objLuceneIndex->find( $objQueryMultiTerm );

    if ( false === empty( $objLuceneQueryHits[0] ) )
    {
        $objLuceneIndex->delete( $objLuceneQueryHits[0]->id );
    }

    $objLuceneDocument->addField( Zend_Search_Lucene_Field::Text( "page_id", 
$arrPage["id"], "UTF-8" ) );

    $objLuceneDocument->addField( Zend_Search_Lucene_Field::UnStored( 
"content", $arrPage["content"], "UTF-8" ) );

    $objLuceneIndex->addDocument( $objLuceneDocument );
}

I need to add one-by-one each element to the index ? can't I do a loop for it ?

Thx for any help.


Reply via email to