Docs For Class Zend_Search_Lucene_Index_Writer

## Class Zend_Search_Lucene_Index_Writer

Description

- license: New BSD License
- copyright: Copyright (c) 2006 Zend Technologies USA Inc. (http://www.zend.com)

Located in /Zend/Search/Lucene/Index/Writer.php (line 41)

Variable Summary
integer $maxBufferedDocs
integer $maxMergeDocs
integer $mergeFactor
Method Summary
Zend_Search_Lucene_Index_Writer __construct (Zend_Search_Lucene_Storage_Directory $directory, &$segmentInfos, [boolean $create = false], array $segmentInfos)
void addDocument (Zend_Search_Lucene_Document $document)
void addIndexes (array $readers)
void commit ()
void optimize ()
Variables
integer $maxBufferedDocs = 10 (line 58)

Number of documents required before the buffered in-memory documents are written into a new Segment

Default value is 10

- access: public

integer $maxMergeDocs = PHP_INT_MAX (line 70)

Largest number of documents ever merged by addDocument().

Small values (e.g., less than 10,000) are best for interactive indexing, as this limits the length of pauses while indexing to a few seconds. Larger values are best for batched indexing and speedier searches.

Default value is PHP_INT_MAX

- access: public

integer $mergeFactor = 10 (line 90)

Determines how often segment indices are merged by addDocument().

With smaller values, less RAM is used while indexing, and searches on unoptimized indices are faster, but indexing speed is slower.

With larger values, more RAM is used during indexing, and while searches on unoptimized indices are slower, indexing is faster.

Thus larger values (> 10) are best for batch index creation, and smaller values (< 10) for indices that are interactively maintained.

Default value is 10

- access: public

Methods
Constructor __construct (line 168)

Opens the index for writing

IndexWriter constructor needs Directory as a parameter. It should be a string with a path to the index folder or a Directory object. Second constructor parameter create is optional - true to create the index or overwrite the existing one.

- access: public

Zend_Search_Lucene_Index_Writer __construct (Zend_Search_Lucene_Storage_Directory $directory, &$segmentInfos, [boolean $create = false], array $segmentInfos)

- Zend_Search_Lucene_Storage_Directory $directory
- array $segmentInfos
- boolean $create
- &$segmentInfos

addDocument (line 208)

Adds a document to this index.

- access: public

void addDocument (Zend_Search_Lucene_Document $document)

- Zend_Search_Lucene_Document $document

addIndexes (line 387)

Merges the provided indexes into this index.

- access: public

void addIndexes (array $readers)

- array $readers

commit (line 364)

Commit current changes

- access: public

void commit ()
optimize (line 401)

Merges all segments together into a single segment, optimizing an index for search.

Input is an array of Zend_Search_Lucene_Index_SegmentInfo objects

- access: public
- throws: Zend_Search_Lucene_Exception

void optimize ()

Documentation generated on Sun, 29 Oct 2006 21:27:37 -0600 by phpDocumentor 1.3.0RC6