Some information for all of you is posting as an answer, so I can use code styles.
$sql = "SELECT id, company, psearch FROM businesses"; $result = $db->query($sql); // Run SQL $feeds = array(); $x = 0; while ( $record = $result->fetch_assoc() ) { $feeds[$x]['id'] = $record['id']; $feeds[$x]['company'] = $record['company']; $feeds[$x]['psearch'] = $record['psearch']; $x++; } //grab each feed foreach($feeds as $feed) { $doc = new Zend_Search_Lucene_Document(); $doc->addField(Zend_Search_Lucene_Field::UnIndexed('id', $feed["id"])); $doc->addField(Zend_Search_Lucene_Field::Text('company', $feed["company"])); $doc->addField(Zend_Search_Lucene_Field::Text('psearch', $feed["psearch"])); $doc->addField(Zend_Search_Lucene_Field::UnIndexed('link', 'http://www.google.com')); //echo "Adding: ". $feed["company"] ."-".$feed['pcode']."\n"; $index->addDocument($doc); } $index->commit();
(I used google.com as a temporary link)
The server on which it works is a local installation of Ubuntu 8.10, 3Gb RAM and a dual-processor Pentium 3.2GHz.
source share