Detailed Description
LuceneSearch provides access to the search based on ZendSearch/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 42 of file LuceneSearch.php.
Public Member Functions | |
__construct () | |
__destruct () | |
setIndexStrategy (IndexStrategy $indexStrategy) | |
setIndexPath ($indexPath) | |
getIndexPath () | |
setLiveUpdate ($liveUpdate) | |
getLiveUpdate () | |
setDefaultLanguageFallback ($defaultLanguageFallback) | |
check ($word) | |
find ($searchTerm, PagingInfo $pagingInfo=null, $createSummary=true) | |
isSearchable (PersistentObject $obj) | |
resetIndex () | |
commitIndex ($optimize=true) | |
optimizeIndex () | |
addToIndex (PersistentObject $obj) | |
deleteFromIndex (ObjectId $oid) | |
afterCommit (TransactionEvent $event) | |
Protected Member Functions | |
getStopWords () | |
Constructor & Destructor Documentation
◆ __construct()
__construct | ( | ) |
Constructor.
Definition at line 56 of file LuceneSearch.php.
◆ __destruct()
__destruct | ( | ) |
Destructor.
Definition at line 70 of file LuceneSearch.php.
Member Function Documentation
◆ setIndexStrategy()
setIndexStrategy | ( | IndexStrategy | $indexStrategy | ) |
Set the IndexStrategy instance.
- Parameters
-
$indexStrategy
Definition at line 80 of file LuceneSearch.php.
◆ setIndexPath()
setIndexPath | ( | $indexPath | ) |
Set the path to the search index.
- Parameters
-
$indexPath Directory relative to main
Definition at line 88 of file LuceneSearch.php.
◆ getIndexPath()
getIndexPath | ( | ) |
◆ setLiveUpdate()
setLiveUpdate | ( | $liveUpdate | ) |
Set if the search index should update itself, when persistent objects are created/updated/deleted.
- Parameters
-
$liveUpdate Boolean
Definition at line 113 of file LuceneSearch.php.
◆ getLiveUpdate()
getLiveUpdate | ( | ) |
Get if the search index should update itself, when persistent objects are created/updated/deleted.
- Returns
- Boolean
Definition at line 122 of file LuceneSearch.php.
◆ setDefaultLanguageFallback()
setDefaultLanguageFallback | ( | $defaultLanguageFallback | ) |
Set if the search index should use the default language, if a translation is missing.
- Parameters
-
$useDefaultLanguage Boolean
Definition at line 130 of file LuceneSearch.php.
◆ check()
check | ( | $word | ) |
◆ find()
find | ( | $searchTerm, | |
PagingInfo | $pagingInfo = null , |
||
$createSummary = true |
|||
) |
◆ isSearchable()
isSearchable | ( | PersistentObject | $obj | ) |
◆ resetIndex()
resetIndex | ( | ) |
- See also
- IndexedSearch::resetIndex()
Implements IndexedSearch.
Definition at line 231 of file LuceneSearch.php.
◆ commitIndex()
commitIndex | ( | $optimize = true | ) |
- See also
- IndexedSearch::commitIndex()
Implements IndexedSearch.
Definition at line 239 of file LuceneSearch.php.
◆ optimizeIndex()
optimizeIndex | ( | ) |
- See also
- IndexedSearch::optimizeIndex()
Implements IndexedSearch.
Definition at line 255 of file LuceneSearch.php.
◆ addToIndex()
addToIndex | ( | PersistentObject | $obj | ) |
- See also
- IndexedSearch::addToIndex()
Implements IndexedSearch.
Definition at line 263 of file LuceneSearch.php.
◆ deleteFromIndex()
deleteFromIndex | ( | ObjectId | $oid | ) |
- See also
- IndexedSearch::deleteFromIndex()
Implements IndexedSearch.
Definition at line 292 of file LuceneSearch.php.
◆ afterCommit()
afterCommit | ( | TransactionEvent | $event | ) |
Listen to TransactionEvents.
- Parameters
-
$event TransactionEvent instance
Definition at line 310 of file LuceneSearch.php.
◆ getStopWords()
|
protected |
Get a list of words that are forbidden to search for.
- Returns
- Array
Definition at line 367 of file LuceneSearch.php.