Index creation and updating capabilities are implemented within the
Zend_Search_Lucene component, as well as the Java Lucene project.
You can use either of these options to create indexes that
Zend_Search_Lucene can search.
The PHP code listing below provides an example of how to index a file
Zend_Search_Lucene indexing API:
// Create index
$index = Zend_Search_Lucene::create('/data/my-index');
$doc = new Zend_Search_Lucene_Document();
// Store document URL to identify it in the search results
// Index document contents
// Add document to the index
Newly added documents are immediately searchable in the index.