## Zend_Search_Lucene_Index_SegmentWriter

Description

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

Located in /Zend/Search/Lucene/Index/SegmentWriter.php (line 43)

Direct descendents

Class | Description
--- | ---
Zend_Search_Lucene_Index_SegmentWriter_DocumentWriter |
Zend_Search_Lucene_Index_SegmentWriter_StreamWriter |

Variable Summary
static integer $indexInterval
static integer $skipInterval
Zend_Search_Lucene_Storage_Directory $_directory
integer $_docCount
Zend_Search_Lucene_Storage_File $_fdtFile
Zend_Search_Lucene_Storage_File $_fdxFile
array $_fields
unknown_type $_files
string $_name
array $_norms
Method Summary
Zend_Search_Lucene_Index_SegmentWriter __construct (Zend_Search_Lucene_Storage_Directory $directory, string $name)
integer addField (Zend_Search_Lucene_Field $field)
integer addFieldInfo (Zend_Search_Lucene_Index_FieldInfo $fieldInfo)
void addStoredFields (array $storedFields)
void addTerm (Zend_Search_Lucene_Index_Term $termEntry, array $termDocs)
Zend_Search_Lucene_Index_SegmentInfo close ()
void closeDictionaryFiles ()
integer count ()
array getFieldInfos ()
void initializeDictionaryFiles ()
void _dumpFNM ()
void _dumpTermDictEntry (Zend_Search_Lucene_Storage_File $dicFile, &$prevTerm, Zend_Search_Lucene_Index_Term $term, &$prevTermInfo, Zend_Search_Lucene_Index_TermInfo $termInfo, Zend_Search_Lucene_Index_Term $prevTerm, Zend_Search_Lucene_Index_TermInfo $prevTermInfo)
void _generateCFS ()
Variables
static integer $indexInterval = 128 (line 54)

Expert: The fraction of terms in the "dictionary" which should be stored

in RAM. Smaller values use more memory, but make searching slightly faster, while larger values use less memory and make searching slightly slower. Searching is typically not dominated by dictionary lookup, so tweaking this is rarely useful.

- access: public

static integer $skipInterval = 0x7FFFFFFF (line 67)

Expert: The fraction of TermDocs entries stored in skip tables.

Larger values result in smaller indexes, greater acceleration, but fewer accelerable cases, while smaller values result in bigger indexes, less acceleration and more accelerable cases. More detailed experiments would be useful here.

0x0x7FFFFFFF indicates that we don't use skip data Default value is 16

- access: public

Zend_Search_Lucene_Storage_Directory $_directory (line 88)

File system adapter.

- access: protected

integer $_docCount = 0 (line 74)

Number of docs in a segment

- access: protected

Zend_Search_Lucene_Storage_File $_fdtFile = null (line 130)

'.fdt' file - Stored Fields, the field data.

- access: protected

Zend_Search_Lucene_Storage_File $_fdxFile = null (line 123)

'.fdx' file - Stored Fields, the field index.

- access: protected

array $_fields = array() (line 103)

Segment fields. Array of Zend_Search_Lucene_Index_FieldInfo objects for this segment

- access: protected

unknown_type $_files = array() (line 96)

List of the index files.

Used for automatic compound file generation

- access: protected

string $_name (line 81)

Segment name

- access: protected

array $_norms = array() (line 115)

Normalization factors.

An array fieldName => normVector normVector is a binary string. Each byte corresponds to an indexed document in a segment and encodes normalization factor (float value, encoded by Zend_Search_Lucene_Search_Similarity::encodeNorm())

- access: protected

Methods
Constructor __construct (line 139)

Object constructor.

- access: public

Zend_Search_Lucene_Index_SegmentWriter __construct (Zend_Search_Lucene_Storage_Directory $directory, string $name)

- Zend_Search_Lucene_Storage_Directory $directory
- string $name

Redefined in descendants as:

- Zend_Search_Lucene_Index_SegmentWriter_DocumentWriter::__construct() : Object constructor.
- Zend_Search_Lucene_Index_SegmentWriter_StreamWriter::__construct() : Object constructor.

addField (line 154)

Add field to the segment

Returns actual field number

- access: public

integer addField (Zend_Search_Lucene_Field $field)

- Zend_Search_Lucene_Field $field

addFieldInfo (line 181)

Add fieldInfo to the segment

Returns actual field number

- access: public

integer addFieldInfo (Zend_Search_Lucene_Index_FieldInfo $fieldInfo)

- Zend_Search_Lucene_Index_FieldInfo $fieldInfo

addStoredFields (line 215)

Add stored fields information

- access: public

void addStoredFields (array $storedFields)

- array $storedFields: array of Zend_Search_Lucene_Field objects

addTerm (line 406)

Add term

Term positions is an array( docId => array(pos1, pos2, pos3, ...), ... )

- access: public

void addTerm (Zend_Search_Lucene_Index_Term $termEntry, array $termDocs)

- Zend_Search_Lucene_Index_Term $termEntry
- array $termDocs

close (line 598)

Close segment, write it to disk and return segment info

- access: public
- abstract:

Zend_Search_Lucene_Index_SegmentInfo close ()

Redefined in descendants as:

- Zend_Search_Lucene_Index_SegmentWriter_DocumentWriter::close() : Close segment, write it to disk and return segment info
- Zend_Search_Lucene_Index_SegmentWriter_StreamWriter::close() : Close segment, write it to disk and return segment info

closeDictionaryFiles (line 460)

Close dictionary

- access: public

void closeDictionaryFiles ()
count (line 249)

Returns the total number of documents in this segment.

- access: public

integer count ()
getFieldInfos (line 205)

Returns array of FieldInfo objects.

- access: public

array getFieldInfos ()
initializeDictionaryFiles (line 357)

Create dicrionary, frequency and positions files and write necessary headers

- access: public

void initializeDictionaryFiles ()
_dumpFNM (line 257)

Dump Field Info (.fnm) segment file

- access: protected

void _dumpFNM ()
_dumpTermDictEntry (line 480)

Dump Term Dictionary segment file entry.

Used to write entry to .tis or .tii files

- access: protected

void _dumpTermDictEntry (Zend_Search_Lucene_Storage_File $dicFile, &$prevTerm, Zend_Search_Lucene_Index_Term $term, &$prevTermInfo, Zend_Search_Lucene_Index_TermInfo $termInfo, Zend_Search_Lucene_Index_Term $prevTerm, Zend_Search_Lucene_Index_TermInfo $prevTermInfo)

- Zend_Search_Lucene_Storage_File $dicFile
- Zend_Search_Lucene_Index_Term $prevTerm
- Zend_Search_Lucene_Index_Term $term
- Zend_Search_Lucene_Index_TermInfo $prevTermInfo
- Zend_Search_Lucene_Index_TermInfo $termInfo
- &$prevTerm
- &$prevTermInfo

_generateCFS (line 557)

Generate compound index file

- access: protected

void _generateCFS ()

Documentation generated on Wed, 21 Feb 2007 11:59:20 -0800 by phpDocumentor 1.3.1