Search/Lucene.php
- Category
- Zend
- Copyright
- Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
- Package
- Zend_Search_Lucene
- Version
- $Id$
\Zend_Search_Lucene
- Implements
- Category
- Zend
- Copyright
- Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
Constants
Properties

boolean $_closeDirOnExit = truetrueDetails- Type
- boolean

boolean $_closed = falsefalseDetails- Type
- boolean

string $_defaultSearchField = nullnullDetails- Type
- string

\Zend_Search_Lucene_Storage_Directory $_directory = nullnullDetails
array $_segmentInfos = array()array()Details- Type
- array

integer $_termsPerQueryLimit = 10241024Details- Type
- integer

\Zend_Search_Lucene_TermStreamsPriorityQueue $_termsStream = nullnullDetailsMethods

__construct(\Zend_Search_Lucene_Storage_Directory_Filesystem | string $directory = null, $create = false) : voidOpens the index.
| Name | Type | Description |
|---|---|---|
| $directory | \Zend_Search_Lucene_Storage_Directory_Filesystem | string | |
| $create |
| Exception | Description |
|---|---|
| \Zend_Search_Lucene_Exception |

_getIndexWriter() : \Zend_Search_Lucene_Index_WriterReturns an instance of Zend_Search_Lucene_Index_Writer for the index
| Type | Description |
|---|---|
| \Zend_Search_Lucene_Index_Writer |

_readPre21SegmentsFile() : voidRead segments file for pre-2.1 Lucene index format
| Exception | Description |
|---|---|
| \Zend_Search_Lucene_Exception |

addDocument(\Zend_Search_Lucene_Document $document) : voidAdds a document to this index.
| Name | Type | Description |
|---|---|---|
| $document | \Zend_Search_Lucene_Document |

closeTermsStream() : voidClose terms stream

commit() : voidCommit changes resulting from delete() or undeleteAll() operations.
- Todo
- undeleteAll processing.

count() : integerReturns the total number of documents in this index (including deleted documents).
| Type | Description |
|---|---|
| integer |

create(mixed $directory) : \Zend_Search_Lucene_InterfaceCreate index
| Name | Type | Description |
|---|---|---|
| $directory | mixed |
| Type | Description |
|---|---|
| \Zend_Search_Lucene_Interface |

currentTerm() : \Zend_Search_Lucene_Index_Term | nullReturns term in current position
| Type | Description |
|---|---|
| \Zend_Search_Lucene_Index_Term | null |

delete(integer | \Zend_Search_Lucene_Search_QueryHit $id) : voidDeletes a document from the index.
| Name | Type | Description |
|---|---|---|
| $id | integer | \Zend_Search_Lucene_Search_QueryHit |
| Exception | Description |
|---|---|
| \Zend_Search_Lucene_Exception |

docFreq(\Zend_Search_Lucene_Index_Term $term) : integerReturns the number of documents in this index containing the $term.
| Name | Type | Description |
|---|---|---|
| $term | \Zend_Search_Lucene_Index_Term |
| Type | Description |
|---|---|
| integer |

find(\Zend_Search_Lucene_Search_QueryParser | string $query) : arrayPerforms a query against the index and returns an array of Zend_Search_Lucene_Search_QueryHit objects.
| Name | Type | Description |
|---|---|---|
| $query | \Zend_Search_Lucene_Search_QueryParser | string |
| Type | Description |
|---|---|
| array | Zend_Search_Lucene_Search_QueryHit |
| Exception | Description |
|---|---|
| \Zend_Search_Lucene_Exception |

getActualGeneration(\Zend_Search_Lucene_Storage_Directory $directory) : integerGet current generation number
| Name | Type | Description |
|---|---|---|
| $directory | \Zend_Search_Lucene_Storage_Directory |
| Type | Description |
|---|---|
| integer |
| Exception | Description |
|---|---|
| \Zend_Search_Lucene_Exception |

getDefaultSearchField() : stringGet default search field.
| Type | Description |
|---|---|
| string |

getDirectory() : \Zend_Search_Lucene_Storage_DirectoryReturns the Zend_Search_Lucene_Storage_Directory instance for this index.
| Type | Description |
|---|---|
| \Zend_Search_Lucene_Storage_Directory |

getDocument(integer | \Zend_Search_Lucene_Search_QueryHit $id) : \Zend_Search_Lucene_DocumentReturns a Zend_Search_Lucene_Document object for the document number $id in this index.
| Name | Type | Description |
|---|---|---|
| $id | integer | \Zend_Search_Lucene_Search_QueryHit |
| Type | Description |
|---|---|
| \Zend_Search_Lucene_Document |
| Exception | Description |
|---|---|
| \Zend_Search_Lucene_Exception | Exception is thrown if $id is out of the range |

getFieldNames(boolean $indexed = false) : arrayReturns a list of all unique field names that exist in this index.
| Name | Type | Description |
|---|---|---|
| $indexed | boolean |
| Type | Description |
|---|---|
| array |

getGeneration() : integerGet generation number associated with this index instance
| Type | Description |
|---|---|
| integer |

getMaxBufferedDocs() : integerRetrieve index maxBufferedDocs option
| Type | Description |
|---|---|
| integer |

getMaxMergeDocs() : integerRetrieve index maxMergeDocs option
| Type | Description |
|---|---|
| integer |

getMergeFactor() : integerRetrieve index mergeFactor option
| Type | Description |
|---|---|
| integer |

getResultSetLimit() : integerGet result set limit.
| Type | Description |
|---|---|
| integer |

getSegmentFileName(integer $generation) : stringGet segments file name
| Name | Type | Description |
|---|---|---|
| $generation | integer |
| Type | Description |
|---|---|
| string |

getSimilarity() : \Zend_Search_Lucene_Search_SimilarityRetrive similarity used by index reader
| Type | Description |
|---|---|
| \Zend_Search_Lucene_Search_Similarity |

getTermsPerQueryLimit() : integerGet result set limit.
| Type | Description |
|---|---|
| integer |

hasDeletions() : booleanReturns true if any documents have been deleted from this index.
| Type | Description |
|---|---|
| boolean |

hasTerm(\Zend_Search_Lucene_Index_Term $term) : booleanReturns true if index contain documents with specified term.
| Name | Type | Description |
|---|---|---|
| $term | \Zend_Search_Lucene_Index_Term |
| Type | Description |
|---|---|
| boolean |

isDeleted(integer $id) : booleanChecks, that document is deleted
| Name | Type | Description |
|---|---|---|
| $id | integer |
| Type | Description |
|---|---|
| boolean |
| Exception | Description |
|---|---|
| \Zend_Search_Lucene_Exception | Exception is thrown if $id is out of the range |

maxDoc() : integerReturns one greater than the largest possible document number.
| Type | Description |
|---|---|
| integer |

nextTerm() : \Zend_Search_Lucene_Index_Term | nullScans terms dictionary and returns next term
| Type | Description |
|---|---|
| \Zend_Search_Lucene_Index_Term | null |

norm(integer $id, string $fieldName) : floatReturns a normalization factor for "field, document" pair.
| Name | Type | Description |
|---|---|---|
| $id | integer | |
| $fieldName | string |
| Type | Description |
|---|---|
| float |

numDocs() : integerReturns the total number of non-deleted documents in this index.
| Type | Description |
|---|---|
| integer |

open(mixed $directory) : \Zend_Search_Lucene_InterfaceOpen index
| Name | Type | Description |
|---|---|---|
| $directory | mixed |
| Type | Description |
|---|---|
| \Zend_Search_Lucene_Interface |

setDefaultSearchField(string $fieldName) : voidSet default search field.
| Name | Type | Description |
|---|---|---|
| $fieldName | string |

setFormatVersion(int $formatVersion) : voidSet index format version.
| Name | Type | Description |
|---|---|---|
| $formatVersion | int |
| Exception | Description |
|---|---|
| \Zend_Search_Lucene_Exception |

setMaxBufferedDocs(integer $maxBufferedDocs) : voidSet index maxBufferedDocs option
| Name | Type | Description |
|---|---|---|
| $maxBufferedDocs | integer |

setMaxMergeDocs(integer $maxMergeDocs) : voidSet index maxMergeDocs option
| Name | Type | Description |
|---|---|---|
| $maxMergeDocs | integer |

setMergeFactor( $mergeFactor) : voidSet index mergeFactor option
| Name | Type | Description |
|---|---|---|
| $mergeFactor |

setResultSetLimit(integer $limit) : voidSet result set limit.
| Name | Type | Description |
|---|---|---|
| $limit | integer |

setTermsPerQueryLimit(integer $limit) : voidSet terms per query limit.
| Name | Type | Description |
|---|---|---|
| $limit | integer |

skipTo(\Zend_Search_Lucene_Index_Term $prefix) : voidSkip terms stream up to the specified term preffix.
| Name | Type | Description |
|---|---|---|
| $prefix | \Zend_Search_Lucene_Index_Term |

termDocs(\Zend_Search_Lucene_Index_Term $term, \Zend_Search_Lucene_Index_DocsFilter | null $docsFilter = null) : arrayReturns IDs of all documents containing term.
| Name | Type | Description |
|---|---|---|
| $term | \Zend_Search_Lucene_Index_Term | |
| $docsFilter | \Zend_Search_Lucene_Index_DocsFilter | null |
| Type | Description |
|---|---|
| array |

termDocsFilter(\Zend_Search_Lucene_Index_Term $term, \Zend_Search_Lucene_Index_DocsFilter | null $docsFilter = null) : \Zend_Search_Lucene_Index_DocsFilterReturns documents filter for all documents containing term.
| Name | Type | Description |
|---|---|---|
| $term | \Zend_Search_Lucene_Index_Term | |
| $docsFilter | \Zend_Search_Lucene_Index_DocsFilter | null |
| Type | Description |
|---|---|
| \Zend_Search_Lucene_Index_DocsFilter |

termFreqs(\Zend_Search_Lucene_Index_Term $term, \Zend_Search_Lucene_Index_DocsFilter | null $docsFilter = null) : integerReturns an array of all term freqs.
| Name | Type | Description |
|---|---|---|
| $term | \Zend_Search_Lucene_Index_Term | |
| $docsFilter | \Zend_Search_Lucene_Index_DocsFilter | null |
| Type | Description |
|---|---|
| integer |

termPositions(\Zend_Search_Lucene_Index_Term $term, \Zend_Search_Lucene_Index_DocsFilter | null $docsFilter = null) : arrayReturns an array of all term positions in the documents.
| Name | Type | Description |
|---|---|---|
| $term | \Zend_Search_Lucene_Index_Term | |
| $docsFilter | \Zend_Search_Lucene_Index_DocsFilter | null |
| Type | Description |
|---|---|
| array |