AbstractSegmentWriter
in package
Tags
Table of Contents
Properties
- $indexInterval : int
- 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.
- $maxSkipLevels : int
- Expert: The maximum number of skip levels. Smaller values result in slightly smaller indexes, but slower skipping in big posting lists.
- $skipInterval : int
- Expert: The fraction of TermDocs entries stored in skip tables.
- $_directory : DirectoryInterface
- File system adapter.
- $_docCount : int
- Number of docs in a segment
- $_fdtFile : FileInterface
- '.fdt' file - Stored Fields, the field data.
- $_fdxFile : FileInterface
- '.fdx' file - Stored Fields, the field index.
- $_fields : array<string|int, mixed>
- Segment fields. Array of Zend_Search_Lucene_Index_FieldInfo objects for this segment
- $_files : array<string|int, mixed>
- List of the index files.
- $_name : string
- Segment name
- $_norms : array<string|int, mixed>
- Normalization factors.
- $_frqFile : FileInterface
- Frequencies file
- $_lastIndexPosition : int
- Last term dictionary file position
- $_prevIndexTerm : Term
- Last saved index term
- $_prevIndexTermInfo : TermInfo
- Last saved index term info
- $_prevTerm : Term
- Last saved term
- $_prevTermInfo : TermInfo
- Last saved term info
- $_prxFile : FileInterface
- Positions file
- $_termCount : int
- Number of written terms
- $_tiiFile : FileInterface
- Term Dictionary index file
- $_tisFile : FileInterface
- Term Dictionary file
Methods
- __construct() : mixed
- Object constructor.
- addField() : int
- Add field to the segment
- addFieldInfo() : int
- Add fieldInfo to the segment
- addStoredFields() : void
- Add stored fields information
- addTerm() : void
- Add term
- close() : SegmentInfo
- Close segment, write it to disk and return segment info
- closeDictionaryFiles() : void
- Close dictionary
- count() : int
- Returns the total number of documents in this segment.
- getFieldInfos() : array<string|int, mixed>
- Returns array of FieldInfo objects.
- getName() : string
- Return segment name
- initializeDictionaryFiles() : void
- Create dicrionary, frequency and positions files and write necessary headers
- _dumpFNM() : void
- Dump Field Info (.fnm) segment file
- _dumpTermDictEntry() : void
- Dump Term Dictionary segment file entry.
- _generateCFS() : void
- Generate compound index file
Properties
$indexInterval
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.
public
static int
$indexInterval
= 128
$maxSkipLevels
Expert: The maximum number of skip levels. Smaller values result in slightly smaller indexes, but slower skipping in big posting lists.
public
static int
$maxSkipLevels
= 0
0 indicates that we don't use skip data
Note: not used in current implementation
$skipInterval
Expert: The fraction of TermDocs entries stored in skip tables.
public
static int
$skipInterval
= 0x7fffffff
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
$_directory
File system adapter.
protected
DirectoryInterface
$_directory
$_docCount
Number of docs in a segment
protected
int
$_docCount
= 0
$_fdtFile
'.fdt' file - Stored Fields, the field data.
protected
FileInterface
$_fdtFile
= null
$_fdxFile
'.fdx' file - Stored Fields, the field index.
protected
FileInterface
$_fdxFile
= null
$_fields
Segment fields. Array of Zend_Search_Lucene_Index_FieldInfo objects for this segment
protected
array<string|int, mixed>
$_fields
= array()
$_files
List of the index files.
protected
array<string|int, mixed>
$_files
= array()
Used for automatic compound file generation
$_name
Segment name
protected
string
$_name
$_norms
Normalization factors.
protected
array<string|int, mixed>
$_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 \ZendSearch\Lucene\Search\Similarity\AbstractSimilarity::encodeNorm())
$_frqFile
Frequencies file
private
FileInterface
$_frqFile
= null
$_lastIndexPosition
Last term dictionary file position
private
int
$_lastIndexPosition
$_prevIndexTerm
Last saved index term
private
Term
$_prevIndexTerm
$_prevIndexTermInfo
Last saved index term info
private
TermInfo
$_prevIndexTermInfo
$_prevTerm
Last saved term
private
Term
$_prevTerm
$_prevTermInfo
Last saved term info
private
TermInfo
$_prevTermInfo
$_prxFile
Positions file
private
FileInterface
$_prxFile
= null
$_termCount
Number of written terms
private
int
$_termCount
$_tiiFile
Term Dictionary index file
private
FileInterface
$_tiiFile
= null
$_tisFile
Term Dictionary file
private
FileInterface
$_tisFile
= null
Methods
__construct()
Object constructor.
public
__construct(DirectoryInterface $directory, string $name) : mixed
Parameters
- $directory : DirectoryInterface
- $name : string
addField()
Add field to the segment
public
addField(Field $field) : int
Returns actual field number
Parameters
- $field : Field
Return values
intaddFieldInfo()
Add fieldInfo to the segment
public
addFieldInfo(FieldInfo $fieldInfo) : int
Returns actual field number
Parameters
- $fieldInfo : FieldInfo
Return values
intaddStoredFields()
Add stored fields information
public
addStoredFields(array<string|int, mixed> $storedFields) : void
Parameters
- $storedFields : array<string|int, mixed>
-
array of \ZendSearch\Lucene\Document\Field objects
addTerm()
Add term
public
addTerm(Term $termEntry, array<string|int, mixed> $termDocs) : void
Term positions is an array( docId => array(pos1, pos2, pos3, ...), ... )
Parameters
- $termEntry : Term
- $termDocs : array<string|int, mixed>
close()
Close segment, write it to disk and return segment info
public
abstract close() : SegmentInfo
Return values
SegmentInfocloseDictionaryFiles()
Close dictionary
public
closeDictionaryFiles() : void
count()
Returns the total number of documents in this segment.
public
count() : int
Return values
intgetFieldInfos()
Returns array of FieldInfo objects.
public
getFieldInfos() : array<string|int, mixed>
Return values
array<string|int, mixed>getName()
Return segment name
public
getName() : string
Return values
stringinitializeDictionaryFiles()
Create dicrionary, frequency and positions files and write necessary headers
public
initializeDictionaryFiles() : void
_dumpFNM()
Dump Field Info (.fnm) segment file
protected
_dumpFNM() : void
_dumpTermDictEntry()
Dump Term Dictionary segment file entry.
protected
_dumpTermDictEntry(FileInterface $dicFile, Term &$prevTerm, Term $term, TermInfo &$prevTermInfo, TermInfo $termInfo) : void
Used to write entry to .tis or .tii files
Parameters
- $dicFile : FileInterface
- $prevTerm : Term
- $term : Term
- $prevTermInfo : TermInfo
- $termInfo : TermInfo
_generateCFS()
Generate compound index file
protected
_generateCFS() : void