I am trying to familiarize with Zend Lucene. However, I have run into some
trouble on one of the first examples.

On $index->commit(); the CPU peaks, and PHP just keeps running until the
maximum execution time is reached. Tested increasing the maximum execution
time, which didn't help. My guess is that it gets stuck in a loop somewhere.

The error that is output is:
Fatal error: Maximum execution time of 30 seconds exceeded in [application
root]/library/Zend/Search/Lucene/Storage/File/Filesystem.php on line 160


OS: OS X 10.5 (also tried Ubuntu 8.04LTS)
ZF: 1.7.0
PHP: 5.2.6

I am using the following code:

<?php
// path to root directory
defined('ROOT_DIR') or define('ROOT_DIR', realpath(
dirname(dirname(__FILE__))) );

// setup directories
$paths = array(
    ROOT_DIR . '/library/',
    ROOT_DIR . '/application/models/',
    ROOT_DIR . '/application/forms/',
);
set_include_path(implode(PATH_SEPARATOR, $paths));


// setup Zend_Loader
require_once "Zend/Loader.php";
Zend_Loader::registerAutoload();

$indexDirectory = ROOT_DIR . '/data/indicies/general';

// Create index
if ($indexDirectory instanceof
Zend_Search_Lucene_Storage_Directory_Filesystem) {
    $index = Zend_Search_Lucene::open($indexDirectory);
} else {
    $index = Zend_Search_Lucene::create($indexDirectory);
}

// the following is from:
//
http://framework.zend.com/manual/en/zend.search.lucene.index-creation.html#zend.search.lucene.index-creation.creating

$doc = new Zend_Search_Lucene_Document();

$doc->addField(Zend_Search_Lucene_Field::Text('url',
'http://www.testing.com'));
$doc->addField(Zend_Search_Lucene_Field::UnStored('contents', 'happy
content'));

$index->addDocument($doc);


print("pre commit");

$index->commit();

print("post commit");

-- 
View this message in context: 
http://www.nabble.com/Zend_Search_Lucene-timeout---loop-problem-tp20619922p20619922.html
Sent from the Zend Framework mailing list archive at Nabble.com.

Reply via email to