API Documentation

Search/Lucene/Index/SegmentWriter.php

Includes Classes 
category
Zend
copyright
Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
license
http://framework.zend.com/license/new-bsd New BSD License
package
Zend_Search_Lucene
subpackage
Index
version
$Id: SegmentWriter.php 20096 2010-01-06 02:05:09Z bkarwin $
Classes
Zend_Search_Lucene_Index_SegmentWriter

Description

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.

Zend_Search_Lucene_Index_SegmentWriter

category
Zend
copyright
Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
license
http://framework.zend.com/license/new-bsd New BSD License
package
Zend_Search_Lucene
subpackage
Index
Properties
$indexInterval
$skipInterval
$maxSkipLevels
$_docCount
$_name
$_directory
$_files
$_fields
$_norms
$_fdxFile
$_fdtFile
$_tisFile
$_tiiFile
$_frqFile
$_prxFile
$_termCount
$_prevTerm
$_prevTermInfo
$_prevIndexTerm
$_prevIndexTermInfo
$_lastIndexPosition
Methods
__construct
addField
addFieldInfo
getFieldInfos
addStoredFields
count
getName
_dumpFNM
initializeDictionaryFiles
addTerm
closeDictionaryFiles
_dumpTermDictEntry
_generateCFS
close

Description

Properties

$_directory

Zend_Search_Lucene_Storage_Directory $_directory = ''

File system adapter.

Details

$_directory
Zend_Search_Lucene_Storage_Directory
visibility
protected
default
final
false
static
false

$_docCount

integer $_docCount = '0'

Number of docs in a segment

Details

$_docCount
integer
visibility
protected
default
0
final
false
static
false

$_fdtFile

Zend_Search_Lucene_Storage_File $_fdtFile = 'null'

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

Details

$_fdtFile
Zend_Search_Lucene_Storage_File
visibility
protected
default
null
final
false
static
false

$_fdxFile

Zend_Search_Lucene_Storage_File $_fdxFile = 'null'

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

Details

$_fdxFile
Zend_Search_Lucene_Storage_File
visibility
protected
default
null
final
false
static
false

$_fields

array $_fields = 'array'

Segment fields. Array of Zend_Search_Lucene_Index_FieldInfo objects for this segment

Details

$_fields
array
visibility
protected
default
array
final
false
static
false

$_files

unknown_type $_files = 'array'

List of the index files.

Used for automatic compound file generation

Details

$_files
unknown_type
visibility
protected
default
array
final
false
static
false

$_frqFile

Zend_Search_Lucene_Storage_File $_frqFile = 'null'

Frequencies file

Details

$_frqFile
Zend_Search_Lucene_Storage_File
visibility
private
default
null
final
false
static
false

$_lastIndexPosition

integer $_lastIndexPosition = ''

Last term dictionary file position

Details

$_lastIndexPosition
integer
visibility
private
default
final
false
static
false

$_name

string $_name = ''

Segment name

Details

$_name
string
visibility
protected
default
final
false
static
false

$_norms

array $_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())

Details

$_norms
array
visibility
protected
default
array
final
false
static
false

$_prevIndexTerm

Zend_Search_Lucene_Index_Term $_prevIndexTerm = ''

Last saved index term

Details

$_prevIndexTerm
Zend_Search_Lucene_Index_Term
visibility
private
default
final
false
static
false

$_prevIndexTermInfo

Zend_Search_Lucene_Index_TermInfo $_prevIndexTermInfo = ''

Last saved index term info

Details

$_prevIndexTermInfo
Zend_Search_Lucene_Index_TermInfo
visibility
private
default
final
false
static
false

$_prevTerm

Zend_Search_Lucene_Index_Term $_prevTerm = ''

Last saved term

Details

$_prevTerm
Zend_Search_Lucene_Index_Term
visibility
private
default
final
false
static
false

$_prevTermInfo

Zend_Search_Lucene_Index_TermInfo $_prevTermInfo = ''

Last saved term info

Details

$_prevTermInfo
Zend_Search_Lucene_Index_TermInfo
visibility
private
default
final
false
static
false

$_prxFile

Zend_Search_Lucene_Storage_File $_prxFile = 'null'

Positions file

Details

$_prxFile
Zend_Search_Lucene_Storage_File
visibility
private
default
null
final
false
static
false

$_termCount

integer $_termCount = ''

Number of written terms

Details

$_termCount
integer
visibility
private
default
final
false
static
false

$_tiiFile

Zend_Search_Lucene_Storage_File $_tiiFile = 'null'

Term Dictionary index file

Details

$_tiiFile
Zend_Search_Lucene_Storage_File
visibility
private
default
null
final
false
static
false

$_tisFile

Zend_Search_Lucene_Storage_File $_tisFile = 'null'

Term Dictionary file

Details

$_tisFile
Zend_Search_Lucene_Storage_File
visibility
private
default
null
final
false
static
false

$indexInterval

integer $indexInterval = '128'

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.

Details

$indexInterval
integer
visibility
public
default
128
final
false
static
true

$maxSkipLevels

integer $maxSkipLevels = '0'

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

Details

$maxSkipLevels
integer
visibility
public
default
0
final
false
static
true

$skipInterval

integer $skipInterval = '0x7FFFFFFF'

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

Details

$skipInterval
integer
visibility
public
default
0x7FFFFFFF
final
false
static
true

Methods

__construct

__construct( Zend_Search_Lucene_Storage_Directory $directory, string $name ) :

Object constructor.

Arguments
$directory
Zend_Search_Lucene_Storage_Directory
$name
string
Details
visibility
public
final
false
static
false

_dumpFNM

_dumpFNM( ) :

Dump Field Info (.fnm) segment file

Details
visibility
protected
final
false
static
false

_dumpTermDictEntry

_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 ) :

Dump Term Dictionary segment file entry.

Used to write entry to .tis or .tii files

Arguments
$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
Details
visibility
protected
final
false
static
false

_generateCFS

_generateCFS( ) :

Generate compound index file

Details
visibility
protected
final
false
static
false

addField

addField( Zend_Search_Lucene_Field $field ) : integer

Add field to the segment

Returns actual field number

Arguments
$field
Zend_Search_Lucene_Field
Output
integer
Details
visibility
public
final
false
static
false

addFieldInfo

addFieldInfo( Zend_Search_Lucene_Index_FieldInfo $fieldInfo ) : integer

Add fieldInfo to the segment

Returns actual field number

Arguments
$fieldInfo
Zend_Search_Lucene_Index_FieldInfo
Output
integer
Details
visibility
public
final
false
static
false

addStoredFields

addStoredFields( array $storedFields ) :

Add stored fields information

Arguments
$storedFields
array
array of Zend_Search_Lucene_Field objects
Details
visibility
public
final
false
static
false

addTerm

addTerm( Zend_Search_Lucene_Index_Term $termEntry, array $termDocs ) :

Add term

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

Arguments
$termEntry
Zend_Search_Lucene_Index_Term
$termDocs
array
Details
visibility
public
final
false
static
false

close

close( ) : Zend_Search_Lucene_Index_SegmentInfo

Close segment, write it to disk and return segment info

Details
visibility
public
final
false
static
false

closeDictionaryFiles

closeDictionaryFiles( ) :

Close dictionary

Details
visibility
public
final
false
static
false

count

count( ) : integer

Returns the total number of documents in this segment.

Output
integer
Details
visibility
public
final
false
static
false

getFieldInfos

getFieldInfos( ) : array

Returns array of FieldInfo objects.

Output
array
Details
visibility
public
final
false
static
false

getName

getName( ) : string

Return segment name

Output
string
Details
visibility
public
final
false
static
false

initializeDictionaryFiles

initializeDictionaryFiles( ) :

Create dicrionary, frequency and positions files and write necessary headers

Details
visibility
public
final
false
static
false
Documentation was generated by DocBlox.