Search/Lucene/Interface.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_Interface
- Parent(s)
- \Zend_Search_Lucene_Index_TermsStream_Interface
- Category
- Zend
- Copyright
- Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
Methods
addDocument(\Zend_Search_Lucene_Document $document) : void
Adds a document to this index.
Name | Type | Description |
---|---|---|
$document | \Zend_Search_Lucene_Document |
count() : integer
Returns the total number of documents in this index (including deleted documents).
Type | Description |
---|---|
integer |
delete(integer | \Zend_Search_Lucene_Search_QueryHit $id) : void
Deletes 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) : integer
Returns the number of documents in this index containing the $term.
Name | Type | Description |
---|---|---|
$term | \Zend_Search_Lucene_Index_Term |
Type | Description |
---|---|
integer |
find(mixed $query) : array
Performs a query against the index and returns an array of Zend_Search_Lucene_Search_QueryHit objects.
Name | Type | Description |
---|---|---|
$query | mixed |
Type | Description |
---|---|
array | Zend_Search_Lucene_Search_QueryHit |
Exception | Description |
---|---|
\Zend_Search_Lucene_Exception |
getActualGeneration(\Zend_Search_Lucene_Storage_Directory $directory) : integer
Get current generation number
Name | Type | Description |
---|---|---|
$directory | \Zend_Search_Lucene_Storage_Directory |
Type | Description |
---|---|
integer |
Exception | Description |
---|---|
\Zend_Search_Lucene_Exception |
getDefaultSearchField() : string
Get default search field.
Type | Description |
---|---|
string |
getDirectory() : \Zend_Search_Lucene_Storage_Directory
Returns 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_Document
Returns 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 |
getFieldNames(boolean $indexed = false) : array
Returns a list of all unique field names that exist in this index.
Name | Type | Description |
---|---|---|
$indexed | boolean |
Type | Description |
---|---|
array |
getMaxBufferedDocs() : integer
Retrieve index maxBufferedDocs option
Type | Description |
---|---|
integer |
getMaxMergeDocs() : integer
Retrieve index maxMergeDocs option
Type | Description |
---|---|
integer |
getMergeFactor() : integer
Retrieve index mergeFactor option
Type | Description |
---|---|
integer |
getResultSetLimit() : integer
Set result set limit.
Type | Description |
---|---|
integer |
getSegmentFileName(integer $generation) : string
Get segments file name
Name | Type | Description |
---|---|---|
$generation | integer |
Type | Description |
---|---|
string |
getSimilarity() : \Zend_Search_Lucene_Search_Similarity
Retrive similarity used by index reader
Type | Description |
---|---|
\Zend_Search_Lucene_Search_Similarity |
hasDeletions() : boolean
Returns true if any documents have been deleted from this index.
Type | Description |
---|---|
boolean |
hasTerm(\Zend_Search_Lucene_Index_Term $term) : boolean
Returns true if index contain documents with specified term.
Name | Type | Description |
---|---|---|
$term | \Zend_Search_Lucene_Index_Term |
Type | Description |
---|---|
boolean |
isDeleted(integer $id) : boolean
Checks, 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() : integer
Returns one greater than the largest possible document number.
Type | Description |
---|---|
integer |
norm(integer $id, string $fieldName) : float
Returns a normalization factor for "field, document" pair.
Name | Type | Description |
---|---|---|
$id | integer | |
$fieldName | string |
Type | Description |
---|---|
float |
numDocs() : integer
Returns the total number of non-deleted documents in this index.
Type | Description |
---|---|
integer |
setDefaultSearchField(string $fieldName) : void
Set default search field.
Name | Type | Description |
---|---|---|
$fieldName | string |
setFormatVersion(int $formatVersion) : void
Set index format version.
Name | Type | Description |
---|---|---|
$formatVersion | int |
Exception | Description |
---|---|
\Zend_Search_Lucene_Exception |
setMaxBufferedDocs(integer $maxBufferedDocs) : void
Set index maxBufferedDocs option
Name | Type | Description |
---|---|---|
$maxBufferedDocs | integer |
setMaxMergeDocs(integer $maxMergeDocs) : void
Set index maxMergeDocs option
Name | Type | Description |
---|---|---|
$maxMergeDocs | integer |
setMergeFactor( $mergeFactor) : void
Set index mergeFactor option
Name | Type | Description |
---|---|---|
$mergeFactor |
setResultSetLimit(integer $limit) : void
Set result set limit.
Name | Type | Description |
---|---|---|
$limit | integer |
termDocs(\Zend_Search_Lucene_Index_Term $term, \Zend_Search_Lucene_Index_DocsFilter | null $docsFilter = null) : array
Returns IDs of all the 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_DocsFilter
Returns 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) : integer
Returns 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) : array
Returns 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 |