Docs For Class Zend_Search_Lucene

## Class Zend_Search_Lucene

Description

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

Located in /Zend/Search/Lucene.php (line 65)

Method Summary
Zend_Search_Lucene __construct ([mixed $directory = null], [ $create = false])
void __destruct ()
void addDocument (Zend_Search_Lucene_Document $document)
void commit ()
integer count ()
void delete (integer|Zend_Search_Lucene_Search_QueryHit $id)
integer docFreq (Zend_Search_Lucene_Index_Term $term)
array find (mixed $query)
Zend_Search_Lucene_Storage_Directory getDirectory ()
Zend_Search_Lucene_Document getDocument (integer|Zend_Search_Lucene_Search_QueryHit $id)
array getFieldNames ([boolean $indexed = false])
Zend_Search_Lucene_Index_Writer getIndexWriter ()
integer getMaxBufferedDocs ()
integer getMaxMergeDocs ()
integer getMergeFactor ()
Zend_Search_Lucene_Search_Similarity getSimilarity ()
boolean hasDeletions ()
Zend_Search_Lucene_Document norm (integer $id, string $fieldName)
void optimize ()
void setMaxBufferedDocs (integer $maxBufferedDocs)
void setMaxMergeDocs (integer $maxMergeDocs)
void setMergeFactor ( $mergeFactor, integer $maxMergeDocs)
array termDocs (Zend_Search_Lucene_Index_Term $term)
array termPositions (Zend_Search_Lucene_Index_Term $term)
array terms ()
void undeleteAll ()
Methods
Constructor __construct (line 119)

Opens the index.

IndexReader constructor needs Directory as a parameter. It should be a string with a path to the index folder or a Directory object.

- access: public
- throws: Zend_Search_Lucene_Exception

Zend_Search_Lucene __construct ([mixed $directory = null], [ $create = false])

- mixed $directory
- $create

Destructor __destruct (line 176)

Object destructor

- access: public

void __destruct ()
addDocument (line 666)

Adds a document to this index.

- access: public

void addDocument (Zend_Search_Lucene_Document $document)

- Zend_Search_Lucene_Document $document

commit (line 689)

Commit changes resulting from delete() or undeleteAll() operations.

- access: public
- todo: undeleteAll processing.

void commit ()
count (line 216)

Returns the total number of documents in this index.

- access: public

integer count ()
delete (line 634)

Deletes a document from the index.

$id is an internal document id

- access: public
- throws: Zend_Search_Lucene_Exception

void delete (integer|Zend_Search_Lucene_Search_QueryHit $id)

- integer|Zend_Search_Lucene_Search_QueryHit $id

docFreq (line 556)

Returns the number of documents in this index containing the $term.

- access: public

integer docFreq (Zend_Search_Lucene_Index_Term $term)

- Zend_Search_Lucene_Index_Term $term

find (line 337)

Performs a query against the index and returns an array of Zend_Search_Lucene_Search_QueryHit objects.

Input is a string or Zend_Search_Lucene_Search_Query.

- return: ZSearchHit
- access: public

array find (mixed $query)

- mixed $query

getDirectory (line 205)

Returns the Zend_Search_Lucene_Storage_Directory instance for this index.

- access: public

Zend_Search_Lucene_Storage_Directory getDirectory ()
getDocument (line 395)

Returns a Zend_Search_Lucene_Document object for the document number $id in this index.

- access: public

Zend_Search_Lucene_Document getDocument (integer|Zend_Search_Lucene_Search_QueryHit $id)

- integer|Zend_Search_Lucene_Search_QueryHit $id

getFieldNames (line 378)

Returns a list of all unique field names that exist in this index.

- access: public

array getFieldNames ([boolean $indexed = false])

- boolean $indexed

getIndexWriter (line 190)

Returns an instance of Zend_Search_Lucene_Index_Writer for the index

- access: public

Zend_Search_Lucene_Index_Writer getIndexWriter ()
getMaxBufferedDocs (line 231)

Retrieve index maxBufferedDocs option

maxBufferedDocs is a minimal number of documents required before the buffered in-memory documents are written into a new Segment

Default value is 10

- access: public

integer getMaxBufferedDocs ()
getMaxMergeDocs (line 263)

Retrieve index maxMergeDocs option

maxMergeDocs is a largest number of documents ever merged by addDocument(). Small values (e.g., less than 10,000) are best for interactive indexing, as this limits the length of pauses while indexing to a few seconds. Larger values are best for batched indexing and speedier searches.

Default value is PHP_INT_MAX

- access: public

integer getMaxMergeDocs ()
getMergeFactor (line 302)

Retrieve index mergeFactor option

mergeFactor determines how often segment indices are merged by addDocument(). With smaller values, less RAM is used while indexing, and searches on unoptimized indices are faster, but indexing speed is slower. With larger values, more RAM is used during indexing, and while searches on unoptimized indices are slower, indexing is faster. Thus larger values (> 10) are best for batch index creation, and smaller values (< 10) for indices that are interactively maintained.

Default value is 10

- access: public

integer getMergeFactor ()
getSimilarity (line 575)

Retrive similarity used by index reader

- access: public

Zend_Search_Lucene_Search_Similarity getSimilarity ()
hasDeletions (line 615)

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

- access: public

boolean hasDeletions ()
norm (line 588)

Returns a normalization factor for "field, document" pair.

- access: public

Zend_Search_Lucene_Document norm (integer $id, string $fieldName)

- integer $id
- string $fieldName

optimize (line 712)

Optimize index.

Merges all segments into one

- access: public

void optimize ()
setMaxBufferedDocs (line 246)

Set index maxBufferedDocs option

maxBufferedDocs is a minimal number of documents required before the buffered in-memory documents are written into a new Segment

Default value is 10

- access: public

void setMaxBufferedDocs (integer $maxBufferedDocs)

- integer $maxBufferedDocs

setMaxMergeDocs (line 280)

Set index maxMergeDocs option

maxMergeDocs is a largest number of documents ever merged by addDocument(). Small values (e.g., less than 10,000) are best for interactive indexing, as this limits the length of pauses while indexing to a few seconds. Larger values are best for batched indexing and speedier searches.

Default value is PHP_INT_MAX

- access: public

void setMaxMergeDocs (integer $maxMergeDocs)

- integer $maxMergeDocs

setMergeFactor (line 324)

Set index mergeFactor option

mergeFactor determines how often segment indices are merged by addDocument(). With smaller values, less RAM is used while indexing, and searches on unoptimized indices are faster, but indexing speed is slower. With larger values, more RAM is used during indexing, and while searches on unoptimized indices are slower, indexing is faster. Thus larger values (> 10) are best for batch index creation, and smaller values (< 10) for indices that are interactively maintained.

Default value is 10

- access: public

void setMergeFactor ( $mergeFactor, integer $maxMergeDocs)

- integer $maxMergeDocs
- $mergeFactor

termDocs (line 458)

Returns an array of all the documents which contain term.

- access: public

array termDocs (Zend_Search_Lucene_Index_Term $term)

- Zend_Search_Lucene_Index_Term $term

termPositions (line 501)

Returns an array of all term positions in the documents.

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

- access: public

array termPositions (Zend_Search_Lucene_Index_Term $term)

- Zend_Search_Lucene_Index_Term $term

terms (line 729)

Returns an array of all terms in this index.

- access: public

array terms ()
undeleteAll (line 768)

Undeletes all documents currently marked as deleted in this index.

- access: public
- todo: Implementation

void undeleteAll ()

Documentation generated on Sun, 29 Oct 2006 21:27:22 -0600 by phpDocumentor 1.3.0RC6