PhpRiot
Become Zend Certified

Prepare for the ZCE exam using our quizzes (web or iPad/iPhone). More info...


When you're ready get 7.5% off your exam voucher using voucher CJQNOV23 at the Zend Store

Updating Index

The same procedure is used to update an existing index. The only difference is that the open() method is called instead of the create() method:

<?php
// Open existing index
$index Zend_Search_Lucene::open('/data/my-index');

$doc = new Zend_Search_Lucene_Document();
// Store document URL to identify it in search result.
$doc->addField(Zend_Search_Lucene_Field::Text('url'$docUrl));
// Index document content
$doc->addField(Zend_Search_Lucene_Field::UnStored('contents',
                                                  
$docContent));

// Add document to the index.
$index->addDocument($doc);

Zend Framework