Class Zend_Search_Lucene_Proxy

Description

Implements interfaces:

Proxy class intended to be used in userland.

It tracks, when index object goes out of scope and forces ndex closing

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

Located in /Search/Lucene/Proxy.php (line 35)


	
			
Method Summary
 static string getDefaultSearchField ()
 static void setDefaultSearchField (string $fieldName)
 Zend_Search_Lucene_Proxy __construct (Zend_Search_Lucene_Interface $index)
 void __destruct ()
 void close ()
 void commit ()
 integer count ()
 array find (mixed $query)
 array getFieldNames ([boolean $indexed = false])
 integer getMaxBufferedDocs ()
 integer getMaxMergeDocs ()
 integer getMergeFactor ()
 boolean hasDeletions ()
 boolean isDeleted (integer $id)
 integer maxDoc ()
 float norm (integer $id, string $fieldName)
 integer numDocs ()
 void optimize ()
 void setMaxBufferedDocs (integer $maxBufferedDocs)
 void setMaxMergeDocs (integer $maxMergeDocs)
 void setMergeFactor ( $mergeFactor, integer $maxMergeDocs)
 array terms ()
 void undeleteAll ()
Methods
static getDefaultSearchField (line 150)

Get default search field.

Null means, that search is performed through all fields by default

  • access: public
static string getDefaultSearchField ()

Implementation of:
Zend_Search_Lucene_Interface::getDefaultSearchField()
Get default search field.
static setDefaultSearchField (line 138)

Set default search field.

Null means, that search is performed through all fields by default

Default value is null

  • access: public
static void setDefaultSearchField (string $fieldName)
  • string $fieldName

Implementation of:
Zend_Search_Lucene_Interface::setDefaultSearchField()
Set default search field.
Constructor __construct (line 49)

Object constructor

  • access: public
Zend_Search_Lucene_Proxy __construct (Zend_Search_Lucene_Interface $index)
Destructor __destruct (line 57)

Object destructor

  • access: public
void __destruct ()
addDocument (line 414)

Adds a document to this index.

  • access: public
void addDocument (Zend_Search_Lucene_Document $document)

Implementation of:
Zend_Search_Lucene_Interface::addDocument()
Adds a document to this index.
close (line 69)

Close current index and free resources

Should be invoked only just before destruction.

  • access: public
void close ()

Implementation of:
Zend_Search_Lucene_Interface::close()
Close current index and free resources
commit (line 422)

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

  • access: public
void commit ()

Implementation of:
Zend_Search_Lucene_Interface::commit()
Commit changes resulting from delete() or undeleteAll() operations.
count (line 90)

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

  • access: public
integer count ()

Implementation of:
Zend_Search_Lucene_Interface::count()
Returns the total number of documents in this index (including deleted documents).
delete (line 404)

Deletes a document from the index.

$id is an internal document id

  • throws: Zend_Search_Lucene_Exception
  • access: public
void delete (integer|Zend_Search_Lucene_Search_QueryHit $id)

Implementation of:
Zend_Search_Lucene_Interface::delete()
Deletes a document from the index.
docFreq (line 360)

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

  • access: public
integer docFreq (Zend_Search_Lucene_Index_Term $term)

Implementation of:
Zend_Search_Lucene_Interface::docFreq()
Returns the number of documents in this index containing the $term.
find (line 274)

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: Zend_Search_Lucene_Search_QueryHit
  • throws: Zend_Search_Lucene_Exception
  • access: public
array find (mixed $query)
  • mixed $query

Implementation of:
Zend_Search_Lucene_Interface::find()
Performs a query against the index and returns an array of Zend_Search_Lucene_Search_QueryHit objects.
getDirectory (line 80)

Returns the Zend_Search_Lucene_Storage_Directory instance for this index.

  • access: public

Implementation of:
Zend_Search_Lucene_Interface::getDirectory()
Returns the Zend_Search_Lucene_Storage_Directory instance for this index.
getDocument (line 301)

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

  • access: public

Implementation of:
Zend_Search_Lucene_Interface::getDocument()
Returns a Zend_Search_Lucene_Document object for the document number $id in this index.
getFieldNames (line 289)

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

  • access: public
array getFieldNames ([boolean $indexed = false])
  • boolean $indexed

Implementation of:
Zend_Search_Lucene_Interface::getFieldNames()
Returns a list of all unique field names that exist in this index.
getMaxBufferedDocs (line 165)

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 ()

Implementation of:
Zend_Search_Lucene_Interface::getMaxBufferedDocs()
Retrieve index maxBufferedDocs option
getMaxMergeDocs (line 198)

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 ()

Implementation of:
Zend_Search_Lucene_Interface::getMaxMergeDocs()
Retrieve index maxMergeDocs option
getMergeFactor (line 238)

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 ()

Implementation of:
Zend_Search_Lucene_Interface::getMergeFactor()
Retrieve index mergeFactor option
getSimilarity (line 370)

Retrive similarity used by index reader

  • access: public

Implementation of:
Zend_Search_Lucene_Interface::getSimilarity()
Retrive similarity used by index reader
hasDeletions (line 392)

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

  • access: public
boolean hasDeletions ()

Implementation of:
Zend_Search_Lucene_Interface::hasDeletions()
Returns true if any documents have been deleted from this index.
hasTerm (line 314)

Returns true if index contain documents with specified term.

Is used for query optimization.

  • access: public
boolean hasTerm (Zend_Search_Lucene_Index_Term $term)

Implementation of:
Zend_Search_Lucene_Interface::hasTerm()
Returns true if index contain documents with specified term.
isDeleted (line 124)

Checks, that document is deleted

  • throws: Zend_Search_Lucene_Exception Exception is thrown if $id is out of the range
  • access: public
boolean isDeleted (integer $id)
  • integer $id

Implementation of:
Zend_Search_Lucene_Interface::isDeleted()
Checks, that document is deleted
maxDoc (line 102)

Returns one greater than the largest possible document number.

This may be used to, e.g., determine how big to allocate a structure which will have an element for every document number in an index.

  • access: public
integer maxDoc ()

Implementation of:
Zend_Search_Lucene_Interface::maxDoc()
Returns one greater than the largest possible document number.
norm (line 382)

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

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

Implementation of:
Zend_Search_Lucene_Interface::norm()
Returns a normalization factor for "field, document" pair.
numDocs (line 112)

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

  • access: public
integer numDocs ()

Implementation of:
Zend_Search_Lucene_Interface::numDocs()
Returns the total number of non-deleted documents in this index.
optimize (line 432)

Optimize index.

Merges all segments into one

  • access: public
void optimize ()

Implementation of:
Zend_Search_Lucene_Interface::optimize()
Optimize index.
setMaxBufferedDocs (line 180)

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

Implementation of:
Zend_Search_Lucene_Interface::setMaxBufferedDocs()
Set index maxBufferedDocs option
setMaxMergeDocs (line 215)

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

Implementation of:
Zend_Search_Lucene_Interface::setMaxMergeDocs()
Set index maxMergeDocs option
setMergeFactor (line 260)

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

Implementation of:
Zend_Search_Lucene_Interface::setMergeFactor()
Set index mergeFactor option
termDocs (line 325)

Returns IDs of all the documents containing term.

  • access: public
array termDocs (Zend_Search_Lucene_Index_Term $term)

Implementation of:
Zend_Search_Lucene_Interface::termDocs()
Returns IDs of all the documents containing term.
termFreqs (line 337)

Returns an array of all term freqs.

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

  • access: public
integer termFreqs (Zend_Search_Lucene_Index_Term $term)

Implementation of:
Zend_Search_Lucene_Interface::termFreqs()
Returns an array of all term freqs.
termPositions (line 349)

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)

Implementation of:
Zend_Search_Lucene_Interface::termPositions()
Returns an array of all term positions in the documents.
terms (line 442)

Returns an array of all terms in this index.

  • access: public
array terms ()

Implementation of:
Zend_Search_Lucene_Interface::terms()
Returns an array of all terms in this index.
undeleteAll (line 450)

Undeletes all documents currently marked as deleted in this index.

  • access: public
void undeleteAll ()

Implementation of:
Zend_Search_Lucene_Interface::undeleteAll()
Undeletes all documents currently marked as deleted in this index.

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