API Documentation

Search/Lucene/Index/SegmentWriter/DocumentWriter.php

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-2011 Zend Technologies USA Inc. (http://www.zend.com)  
license
New BSD License  
package
Zend_Search_Lucene  
subpackage
Index  
version
$Id: DocumentWriter.php 23775 2011-03-01 17:25:24Z ralph $  

\Zend_Search_Lucene_Index_SegmentWriter_DocumentWriter

Extends from
\Zend_Search_Lucene_Index_SegmentWriter
category
Zend  
copyright
Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)  
license
New BSD License  
package
Zend_Search_Lucene  
subpackage
Index  

Properties

Propertyprotectedarray  $_termDictionary= ''

Term Dictionary Array of the Zend_Search_Lucene_Index_Term objects Corresponding Zend_Search_Lucene_Index_TermInfo object stored in the $_termDictionaryInfos

Details
Type
array
Propertyprotectedarray  $_termDocs= ''

Documents, which contain the term

Details
Type
array

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

Dump Term Dictionary (.tis) and Term Dictionary Index (.tii) segment files

methodprotected_dumpFNM( ) : void

Dump Field Info (.fnm) segment file

Inherited from: \Zend_Search_Lucene_Index_SegmentWriter::_dumpFNM()
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.

Inherited from: \Zend_Search_Lucene_Index_SegmentWriter::_dumpTermDictEntry()

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

Inherited from: \Zend_Search_Lucene_Index_SegmentWriter::_generateCFS()
methodpublicaddDocument( \Zend_Search_Lucene_Document $document ) : void

Adds a document to this segment.

Parameters
Name Type Description
$document \Zend_Search_Lucene_Document
Throws
Exception Description
\Zend_Search_Lucene_Exception
methodpublicaddField( \Zend_Search_Lucene_Field $field ) : integer

Add field to the segment

Inherited from: \Zend_Search_Lucene_Index_SegmentWriter::addField()

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

Inherited from: \Zend_Search_Lucene_Index_SegmentWriter::addFieldInfo()

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

Inherited from: \Zend_Search_Lucene_Index_SegmentWriter::addStoredFields()
Parameters
Name Type Description
$storedFields array array of Zend_Search_Lucene_Field objects
methodpublicaddTerm( \Zend_Search_Lucene_Index_Term $termEntry, array $termDocs ) : void

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

Close segment, write it to disk and return segment info

Returns
Type Description
\Zend_Search_Lucene_Index_SegmentInfo
methodpubliccloseDictionaryFiles( ) : void
methodpubliccount( ) : integer

Returns the total number of documents in this segment.

Inherited from: \Zend_Search_Lucene_Index_SegmentWriter::count()
Returns
Type Description
integer
methodpublicgetFieldInfos( ) : array

Returns array of FieldInfo objects.

Inherited from: \Zend_Search_Lucene_Index_SegmentWriter::getFieldInfos()
Returns
Type Description
array
methodpublicgetName( ) : string

Return segment name

Inherited from: \Zend_Search_Lucene_Index_SegmentWriter::getName()
Returns
Type Description
string
methodpublicinitializeDictionaryFiles( ) : void

Create dicrionary, frequency and positions files and write necessary headers

Inherited from: \Zend_Search_Lucene_Index_SegmentWriter::initializeDictionaryFiles()
Documentation was generated by DocBlox 0.13.3.