Class Zend_Search_Lucene_Index_SegmentInfo

Description
  • copyright: Copyright (c) 2005-2007 Zend Technologies USA Inc. (http://www.zend.com)
  • license: New BSD License

Located in /Search/Lucene/Index/SegmentInfo.php (line 37)


	
			
Method Summary
 Zend_Search_Lucene_Index_SegmentInfo __construct (string $name, integer $docCount, Zend_Search_Lucene_Storage_Directory $directory)
 integer compoundFileLength (string $extension)
 integer count ()
 void delete (integer $id)
 array getFieldInfos ()
 integer getFieldNum (string $fieldName)
 array getFields ([boolean $indexed = false])
 string getName ()
 boolean hasDeletions ()
 boolean isDeleted (integer $id)
 float norm (integer $id, string $fieldName)
 string normVector (string $fieldName)
 integer numDocs ()
 Zend_Search_Lucene_Storage_File openCompoundFile (string $extension, [boolean $shareHandler = true])
 integer reset ([integer $startId = 0], [boolean $compact = false])
 void writeChanges ()
Methods
Constructor __construct (line 157)

Zend_Search_Lucene_Index_SegmentInfo constructor needs Segmentname, Documents count and Directory as a parameter.

  • access: public
Zend_Search_Lucene_Index_SegmentInfo __construct (string $name, integer $docCount, Zend_Search_Lucene_Storage_Directory $directory)
compoundFileLength (line 273)

Get compound file length

  • access: public
integer compoundFileLength (string $extension)
  • string $extension
count (line 351)

Returns the total number of documents in this segment (including deleted documents).

  • access: public
integer count ()
currentTerm (line 1039)

Returns term in current position

  • access: public
currentTermPositions (line 1051)

Returns an array of all term positions in the documents.

Return array structure: array( docId => array( pos1, pos2, ...), ...)

  • access: public
array currentTermPositions ()
delete (line 740)

Deletes a document from the index segment.

$id is an internal document id

  • access: public
void delete (integer $id)
  • integer $id
getField (line 313)

Returns field info for specified field

  • access: public
Zend_Search_Lucene_Index_FieldInfo getField (integer $fieldNum)
  • integer $fieldNum
getFieldInfos (line 341)

Returns array of FieldInfo objects.

  • access: public
array getFieldInfos ()
getFieldNum (line 296)

Returns field index or -1 if field is not found

  • access: public
integer getFieldNum (string $fieldName)
  • string $fieldName
getFields (line 325)

Returns array of fields.

if $indexed parameter is true, then returns only indexed fields.

  • access: public
array getFields ([boolean $indexed = false])
  • boolean $indexed
getName (line 405)

Return segment name

  • access: public
string getName ()
getTermInfo (line 440)

Scans terms dictionary and returns term info

  • access: public
hasDeletions (line 728)

Returns true if any documents have been deleted from this index segment.

  • access: public
boolean hasDeletions ()
isDeleted (line 764)

Checks, that document is deleted

  • access: public
boolean isDeleted (integer $id)
  • integer $id
nextTerm (line 959)

Scans terms dictionary and returns next term

  • access: public
norm (line 683)

Returns normalization factor for specified documents

  • access: public
float norm (integer $id, string $fieldName)
  • integer $id
  • string $fieldName
normVector (line 704)

Returns norm vector, encoded in a byte string

  • access: public
string normVector (string $fieldName)
  • string $fieldName
numDocs (line 379)

Returns the total number of non-deleted documents in this segment.

  • access: public
integer numDocs ()
openCompoundFile (line 248)

Opens index file stoted within compound index file

  • throws: Zend_Search_Lucene_Exception
  • access: public
Zend_Search_Lucene_Storage_File openCompoundFile (string $extension, [boolean $shareHandler = true])
  • string $extension
  • boolean $shareHandler
reset (line 911)

Reset terms stream

$startId - id for the fist document $compact - remove deleted documents

Returns start document id for the next segment

  • throws: Zend_Search_Lucene_Exception
  • access: public
integer reset ([integer $startId = 0], [boolean $compact = false])
  • integer $startId
  • boolean $compact
termFreqs (line 588)

Returns term freqs array.

Result array structure: array(docId => freq, ...)

  • access: public
Zend_Search_Lucene_Index_TermInfo termFreqs (Zend_Search_Lucene_Index_Term $term, [integer $shift = 0])
termPositions (line 623)

Returns term positions array.

Result array structure: array(docId => array(pos1, pos2, ...), ...)

  • access: public
Zend_Search_Lucene_Index_TermInfo termPositions (Zend_Search_Lucene_Index_Term $term, [integer $shift = 0])
writeChanges (line 781)

Write changes if it's necessary.

  • access: public
void writeChanges ()

Documentation generated on Sun, 27 May 2007 23:27:24 -0700 by phpDocumentor 1.3.2