Search/Lucene/Interface.php
Zend Framework
LICENSE
This source file is subject to the new BSD license that is bundled
with this package in the file LICENSE.txt.
It is also available through the world-wide-web at this URL:
http://framework.zend.com/license/new-bsd
If you did not receive a copy of the license and are unable to
obtain it through the world-wide-web, please send an email
to license@zend.com so we can send you a copy immediately.
- 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
Package: Zend_Search_Lucene- 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
find(mixed $query) : array
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.
ParametersName | Type | Description |
---|
$query | mixed | |
---|
ReturnsType | Description |
---|
array | Zend_Search_Lucene_Search_QueryHit |
ThrowsgetActualGeneration(\Zend_Search_Lucene_Storage_Directory $directory) : integer
staticGet current generation number
Returns generation number
0 means pre-2.1 index format
-1 means there are no segments files.
ParametersReturnsThrowsgetDefaultSearchField() : string
staticGet default search field.
Null means, that search is performed through all fields by default
ReturnsgetFieldNames(boolean $indexed = false) : array
Returns a list of all unique field names that exist in this index.
ParametersName | Type | Description |
---|
$indexed | boolean | |
---|
Returns getMaxBufferedDocs() : integer
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
ReturnsgetMaxMergeDocs() : integer
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
ReturnsgetMergeFactor() : integer
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
ReturnsgetSegmentFileName(integer $generation) : string
staticGet segments file name
ParametersName | Type | Description |
---|
$generation | integer | |
---|
Returns hasTerm(\Zend_Search_Lucene_Index_Term $term) : boolean
Returns true if index contain documents with specified term.
Is used for query optimization.
ParametersReturnsisDeleted(integer $id) : boolean
Checks, that document is deleted
ParametersName | Type | Description |
---|
$id | integer | |
---|
ReturnsThrows maxDoc() : integer
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.
Returnsnorm(integer $id, string $fieldName) : float
Returns a normalization factor for "field, document" pair.
ParametersName | Type | Description |
---|
$id | integer | |
---|
$fieldName | string | |
---|
Returns setDefaultSearchField(string $fieldName) : void
staticSet default search field.
Null means, that search is performed through all fields by default
Default value is null
ParametersName | Type | Description |
---|
$fieldName | string | |
---|
setFormatVersion(int $formatVersion) : void
Set index format version.
Index is converted to this format at the nearest upfdate time
ParametersName | Type | Description |
---|
$formatVersion | int | |
---|
ThrowssetMaxBufferedDocs(integer $maxBufferedDocs) : void
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
ParametersName | Type | Description |
---|
$maxBufferedDocs | integer | |
---|
setMaxMergeDocs(integer $maxMergeDocs) : void
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
ParametersName | Type | Description |
---|
$maxMergeDocs | integer | |
---|
setMergeFactor( $mergeFactor) : void
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
ParametersName | Type | Description |
---|
$mergeFactor | | |
---|
setResultSetLimit(integer $limit) : void
staticSet result set limit.
0 (default) means no limit
ParametersName | Type | Description |
---|
$limit | integer | |
---|