API Documentation

Zend/Search/Lucene/Index/SegmentWriter.php

Show: inherited
Table of Contents

Zend Framework

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: SegmentWriter.php 24594 2012-01-05 21:27:01Z matthew $  

\Zend_Search_Lucene_Index_SegmentWriter

Package: Zend\Search\Lucene\Index

Children
\Zend_Search_Lucene_Index_SegmentWriter_DocumentWriter
\Zend_Search_Lucene_Index_SegmentWriter_StreamWriter
Category
Zend  
Copyright
Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  

Properties

Propertyprotected\Zend_Search_Lucene_Storage_Directory  $_directory= ''

File system adapter.

Propertyprotectedinteger  $_docCount= '0'

Number of docs in a segment

Default value0Details
Type
integer
Propertyprotected\Zend_Search_Lucene_Storage_File  $_fdtFile= 'null'

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

Default valuenullDetails
Type
\Zend_Search_Lucene_Storage_File
Propertyprotected\Zend_Search_Lucene_Storage_File  $_fdxFile= 'null'

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

Default valuenullDetails
Type
\Zend_Search_Lucene_Storage_File
Propertyprotectedarray  $_fields= 'array()'

Segment fields. Array of Zend_Search_Lucene_Index_FieldInfo objects for this segment

Default valuearray()Details
Type
array
Propertyprotected\unknown_type  $_files= 'array()'

List of the index files.

Used for automatic compound file generation

Default valuearray()Details
Type
\unknown_type
Propertyprivate\Zend_Search_Lucene_Storage_File  $_frqFile= 'null'

Frequencies file

Default valuenullDetails
Type
\Zend_Search_Lucene_Storage_File
Propertyprivateinteger  $_lastIndexPosition= ''

Last term dictionary file position

Details
Type
integer
Propertyprotectedstring  $_name= ''

Segment name

Details
Type
string
Propertyprotectedarray  $_norms= 'array()'

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())

Default valuearray()Details
Type
array
Propertyprivate\Zend_Search_Lucene_Index_Term  $_prevIndexTerm= ''

Last saved index term

Propertyprivate\Zend_Search_Lucene_Index_TermInfo  $_prevIndexTermInfo= ''

Last saved index term info

Propertyprivate\Zend_Search_Lucene_Index_Term  $_prevTerm= ''

Last saved term

Propertyprivate\Zend_Search_Lucene_Index_TermInfo  $_prevTermInfo= ''

Last saved term info

Propertyprivate\Zend_Search_Lucene_Storage_File  $_prxFile= 'null'

Positions file

Default valuenullDetails
Type
\Zend_Search_Lucene_Storage_File
Propertyprivateinteger  $_termCount= ''

Number of written terms

Details
Type
integer
Propertyprivate\Zend_Search_Lucene_Storage_File  $_tiiFile= 'null'

Term Dictionary index file

Default valuenullDetails
Type
\Zend_Search_Lucene_Storage_File
Propertyprivate\Zend_Search_Lucene_Storage_File  $_tisFile= 'null'

Term Dictionary file

Default valuenullDetails
Type
\Zend_Search_Lucene_Storage_File
Propertypublicinteger  $indexInterval= '128'
static

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.

Default value128Details
Type
integer
Propertypublicinteger  $maxSkipLevels= '0'
static

Expert: The maximum number of skip levels. 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

Default value0Details
Type
integer
Propertypublicinteger  $skipInterval= '0x7FFFFFFF'
static

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.

0x7FFFFFFF indicates that we don't use skip data

Note: not used in current implementation

Default value0x7FFFFFFFDetails
Type
integer

Methods

methodpublic__construct( \Zend_Search_Lucene_Storage_Directory $directory, string $name ) : void

Object constructor.

Parameters
Name Type Description
$directory \Zend_Search_Lucene_Storage_Directory
$name string
methodprotected_dumpFNM( ) : void

Dump Field Info (.fnm) segment file

methodprotected_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.

Used to write entry to .tis or .tii files

Parameters
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
methodprotected_generateCFS( ) : void

Generate compound index file

methodpublicaddField( \Zend_Search_Lucene_Field $field ) : integer

Add field to the segment

Returns actual field number

Parameters
Name Type Description
$field \Zend_Search_Lucene_Field
Returns
Type Description
integer
methodpublicaddFieldInfo( \Zend_Search_Lucene_Index_FieldInfo $fieldInfo ) : integer

Add fieldInfo to the segment

Returns actual field number

Parameters
Name Type Description
$fieldInfo \Zend_Search_Lucene_Index_FieldInfo
Returns
Type Description
integer
methodpublicaddStoredFields( array $storedFields ) : void

Add stored fields information

Parameters
Name Type Description
$storedFields array

array of Zend_Search_Lucene_Field objects

methodpublicaddTerm( \Zend_Search_Lucene_Index_Term $termEntry, array $termDocs ) : void

Add term

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

Parameters
Name Type Description
$termEntry \Zend_Search_Lucene_Index_Term
$termDocs array
methodpublicclose( ) : \Zend_Search_Lucene_Index_SegmentInfo
abstract

Close segment, write it to disk and return segment info

Returns
Type Description
\Zend_Search_Lucene_Index_SegmentInfo
methodpubliccloseDictionaryFiles( ) : void

Close dictionary

methodpubliccount( ) : integer

Returns the total number of documents in this segment.

Returns
Type Description
integer
methodpublicgetFieldInfos( ) : array

Returns array of FieldInfo objects.

Returns
Type Description
array
methodpublicgetName( ) : string

Return segment name

Returns
Type Description
string
methodpublicinitializeDictionaryFiles( ) : void

Create dicrionary, frequency and positions files and write necessary headers

Documentation was generated by DocBlox 0.15.1.