Detailed Description
LuceneSearch provides access to the search based on Zend_Search_Lucene.
The search index stored in the location that is defined by the parameter 'indexPath'. To manage PersistentObjects in the index use the methods LuceneSearch::addToIndex() and LuceneSearch::deleteFromIndex() and LuceneSearch::commitIndex(). The method LuceneSearch::getIndex() offers direct access to the search index for advanced operations.
Definition at line 34 of file LuceneSearch.php.
Public Member Functions | |
__construct () | |
__destruct () | |
setIndexPath ($indexPath) | |
getIndexPath () | |
setLiveUpdate ($liveUpdate) | |
getLiveUpdate () | |
check ($word) | |
find ($searchTerm, PagingInfo $pagingInfo=null) | |
isSearchable (PersistentObject $obj) | |
resetIndex () | |
commitIndex ($optimize=true) | |
optimizeIndex () | |
addToIndex (PersistentObject $obj) | |
deleteFromIndex (PersistentObject $obj) | |
stateChanged (StateChangeEvent $event) | |
Protected Member Functions | |
encodeValue ($value, $inputType) | |
getStopWords () | |
Constructor & Destructor Documentation
__construct | ( | ) |
Constructor.
Definition at line 46 of file LuceneSearch.php.
__destruct | ( | ) |
Destructor.
Definition at line 58 of file LuceneSearch.php.
Member Function Documentation
setIndexPath | ( | $indexPath | ) |
Set the path to the search index.
- Parameters
-
$indexPath Directory relative to main
Definition at line 68 of file LuceneSearch.php.
getIndexPath | ( | ) |
setLiveUpdate | ( | $liveUpdate | ) |
Set if the search index should update itself, when persistent objects are created/updated/deleted.
- Parameters
-
$liveUpdate Boolean
Definition at line 91 of file LuceneSearch.php.
getLiveUpdate | ( | ) |
Get if the search index should update itself, when persistent objects are created/updated/deleted.
- Returns
- Boolean
Definition at line 100 of file LuceneSearch.php.
check | ( | $word | ) |
find | ( | $searchTerm, | |
PagingInfo | $pagingInfo = null |
||
) |
isSearchable | ( | PersistentObject | $obj | ) |
resetIndex | ( | ) |
- See also
- IndexedSearch::resetIndex()
Implements IndexedSearch.
Definition at line 188 of file LuceneSearch.php.
commitIndex | ( | $optimize = true | ) |
- See also
- IndexedSearch::commitIndex()
Implements IndexedSearch.
Definition at line 196 of file LuceneSearch.php.
optimizeIndex | ( | ) |
- See also
- IndexedSearch::optimizeIndex()
Implements IndexedSearch.
Definition at line 212 of file LuceneSearch.php.
addToIndex | ( | PersistentObject | $obj | ) |
- See also
- IndexedSearch::addToIndex()
Implements IndexedSearch.
Definition at line 222 of file LuceneSearch.php.
deleteFromIndex | ( | PersistentObject | $obj | ) |
- See also
- IndexedSearch::deleteFromIndex()
Implements IndexedSearch.
Definition at line 284 of file LuceneSearch.php.
stateChanged | ( | StateChangeEvent | $event | ) |
Listen to StateChangeEvents.
- Parameters
-
$event StateChangeEvent instance
Definition at line 304 of file LuceneSearch.php.
|
protected |
Encode the given value according to the input type.
- Parameters
-
$value $inputType
- Returns
- String
Definition at line 358 of file LuceneSearch.php.
|
protected |
Get a list of words that are forbidden to search for.
- Returns
- Array
Definition at line 369 of file LuceneSearch.php.