Search/Lucene/Index/SegmentWriter/StreamWriter.php
LICENSE
This source file is subject to the new BSD license that is bundled with this package in the file LICENSE.txt. It is also available through the world-wide-web at this URL: http://framework.zend.com/license/new-bsd If you did not receive a copy of the license and are unable to obtain it through the world-wide-web, please send an email to license@zend.com so we can send you a copy immediately.
- Category
- Zend
- Copyright
- Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
- Package
- Zend_Search_Lucene
- Subpackage
- Index
- Version
- $Id: StreamWriter.php 24593 2012-01-05 20:35:02Z matthew $
\Zend_Search_Lucene_Index_SegmentWriter_StreamWriter
- Parent(s)
- \Zend_Search_Lucene_Index_SegmentWriter
- Category
- Zend
- Copyright
- Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
Properties


integer $_docCount = 0
0
Details- Type
- integer
- Inherited_from
- \Zend_Search_Lucene_Index_SegmentWriter::$$_docCount


\Zend_Search_Lucene_Storage_File $_fdtFile = null
null
Details

\Zend_Search_Lucene_Storage_File $_fdxFile = null
null
Details

array $_fields = array()
Array of Zend_Search_Lucene_Index_FieldInfo objects for this segment
array()
Details- Type
- array
- Inherited_from
- \Zend_Search_Lucene_Index_SegmentWriter::$$_fields


\unknown_type $_files = array()
Used for automatic compound file generation
array()
Details- Type
- \unknown_type
- Inherited_from
- \Zend_Search_Lucene_Index_SegmentWriter::$$_files


integer $_lastIndexPosition
- Type
- integer
- Inherited_from
- \Zend_Search_Lucene_Index_SegmentWriter::$$_lastIndexPosition


array $_norms = array()
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())
array()
Details- Type
- array
- Inherited_from
- \Zend_Search_Lucene_Index_SegmentWriter::$$_norms


\Zend_Search_Lucene_Index_Term $_prevIndexTerm


\Zend_Search_Lucene_Index_TermInfo $_prevIndexTermInfo


\Zend_Search_Lucene_Index_TermInfo $_prevTermInfo


integer $_termCount
- Type
- integer
- Inherited_from
- \Zend_Search_Lucene_Index_SegmentWriter::$$_termCount


\Zend_Search_Lucene_Storage_File $_tiiFile = null
null
Details

integer $indexInterval = 128
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.
128
Details- Type
- integer
- Inherited_from
- \Zend_Search_Lucene_Index_SegmentWriter::$$indexInterval


integer $maxSkipLevels = 0
Smaller values result in slightly smaller indexes, but slower skipping in big posting lists.
0 indicates that we don't use skip data
Note: not used in current implementation
0
Details- Type
- integer
- Inherited_from
- \Zend_Search_Lucene_Index_SegmentWriter::$$maxSkipLevels


integer $skipInterval = 2147483647
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.
0x7FFFFFFF indicates that we don't use skip data
Note: not used in current implementation
2147483647
Details- Type
- integer
- Inherited_from
- \Zend_Search_Lucene_Index_SegmentWriter::$$skipInterval
Methods


__construct(\Zend_Search_Lucene_Storage_Directory $directory, string $name) : void
Object constructor.
Name | Type | Description |
---|---|---|
$directory | \Zend_Search_Lucene_Storage_Directory | |
$name | string |


_dumpFNM() : void
Dump Field Info (.fnm) segment file
Inherited from: \Zend_Search_Lucene_Index_SegmentWriter::_dumpFNM()

_dumpTermDictEntry(\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) : void
Dump Term Dictionary segment file entry.
Inherited from: \Zend_Search_Lucene_Index_SegmentWriter::_dumpTermDictEntry()Used to write entry to .tis or .tii files
Name | Type | Description |
---|---|---|
$dicFile | \Zend_Search_Lucene_Storage_File | |
$prevTerm | \Zend_Search_Lucene_Index_Term | |
$term | \Zend_Search_Lucene_Index_Term | |
$prevTermInfo | \Zend_Search_Lucene_Index_TermInfo | |
$termInfo | \Zend_Search_Lucene_Index_TermInfo |


_generateCFS() : void
Generate compound index file
Inherited from: \Zend_Search_Lucene_Index_SegmentWriter::_generateCFS()

addField(\Zend_Search_Lucene_Field $field) : integer
Add field to the segment
Inherited from: \Zend_Search_Lucene_Index_SegmentWriter::addField()Returns actual field number
Name | Type | Description |
---|---|---|
$field | \Zend_Search_Lucene_Field |
Type | Description |
---|---|
integer |


addFieldInfo(\Zend_Search_Lucene_Index_FieldInfo $fieldInfo) : integer
Add fieldInfo to the segment
Inherited from: \Zend_Search_Lucene_Index_SegmentWriter::addFieldInfo()Returns actual field number
Name | Type | Description |
---|---|---|
$fieldInfo | \Zend_Search_Lucene_Index_FieldInfo |
Type | Description |
---|---|
integer |


addStoredFields(array $storedFields) : void
Add stored fields information
Inherited from: \Zend_Search_Lucene_Index_SegmentWriter::addStoredFields()Name | Type | Description |
---|---|---|
$storedFields | array | array of Zend_Search_Lucene_Field objects |


addTerm(\Zend_Search_Lucene_Index_Term $termEntry, array $termDocs) : void
Term positions is an array( docId => array(pos1, pos2, pos3, ...), ... )
Name | Type | Description |
---|---|---|
$termEntry | \Zend_Search_Lucene_Index_Term | |
$termDocs | array |


close() : \Zend_Search_Lucene_Index_SegmentInfo
Close segment, write it to disk and return segment info
Type | Description |
---|---|
\Zend_Search_Lucene_Index_SegmentInfo |


closeDictionaryFiles() : void
Close dictionary
Inherited from: \Zend_Search_Lucene_Index_SegmentWriter::closeDictionaryFiles()

count() : integer
Returns the total number of documents in this segment.
Inherited from: \Zend_Search_Lucene_Index_SegmentWriter::count()Type | Description |
---|---|
integer |


getFieldInfos() : array
Returns array of FieldInfo objects.
Inherited from: \Zend_Search_Lucene_Index_SegmentWriter::getFieldInfos()Type | Description |
---|---|
array |


initializeDictionaryFiles() : void
Create dicrionary, frequency and positions files and write necessary headers
Inherited from: \Zend_Search_Lucene_Index_SegmentWriter::initializeDictionaryFiles()