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.

Author
Niko enika.nosp@m.o@us.nosp@m.ers.s.nosp@m.ourc.nosp@m.eforg.nosp@m.e.ne.nosp@m.t

Definition at line 42 of file LuceneSearch.php.

+ Inheritance diagram for LuceneSearch:

Public Member Functions

 __construct ()
 
 __destruct ()
 
 setIndexStrategy (IndexStrategy $indexStrategy)
 
 setIndexPath ($indexPath)
 
 getIndexPath ()
 
 setLiveUpdate ($liveUpdate)
 
 getLiveUpdate ()
 
 check ($word)
 
 find ($searchTerm, PagingInfo $pagingInfo=null, $createSummary=true)
 
 isSearchable (PersistentObject $obj)
 
 resetIndex ()
 
 commitIndex ($optimize=true)
 
 optimizeIndex ()
 
 addToIndex (PersistentObject $obj)
 
 deleteFromIndex (PersistentObject $obj)
 
 stateChanged (StateChangeEvent $event)
 

Protected Member Functions

 getStopWords ()
 

Constructor & Destructor Documentation

__construct ( )

Constructor.

Definition at line 55 of file LuceneSearch.php.

__destruct ( )

Destructor.

Definition at line 69 of file LuceneSearch.php.

Member Function Documentation

setIndexStrategy ( IndexStrategy  $indexStrategy)

Set the IndexStrategy instance.

Parameters
$indexStrategy

Definition at line 79 of file LuceneSearch.php.

setIndexPath (   $indexPath)

Set the path to the search index.

Parameters
$indexPathDirectory relative to main

Definition at line 87 of file LuceneSearch.php.

getIndexPath ( )

Get the path to the search index.

Returns
String

Definition at line 101 of file LuceneSearch.php.

setLiveUpdate (   $liveUpdate)

Set if the search index should update itself, when persistent objects are created/updated/deleted.

Parameters
$liveUpdateBoolean

Definition at line 110 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 119 of file LuceneSearch.php.

check (   $word)
See also
Search::check()

Implements Search.

Definition at line 126 of file LuceneSearch.php.

find (   $searchTerm,
PagingInfo  $pagingInfo = null,
  $createSummary = true 
)
See also
Search::find()

Implements Search.

Definition at line 141 of file LuceneSearch.php.

isSearchable ( PersistentObject  $obj)
See also
Search::isSearchable()

Implements Search.

Definition at line 202 of file LuceneSearch.php.

resetIndex ( )
See also
IndexedSearch::resetIndex()

Implements IndexedSearch.

Definition at line 209 of file LuceneSearch.php.

commitIndex (   $optimize = true)
See also
IndexedSearch::commitIndex()

Implements IndexedSearch.

Definition at line 217 of file LuceneSearch.php.

optimizeIndex ( )
See also
IndexedSearch::optimizeIndex()

Implements IndexedSearch.

Definition at line 231 of file LuceneSearch.php.

addToIndex ( PersistentObject  $obj)
See also
IndexedSearch::addToIndex()

Implements IndexedSearch.

Definition at line 239 of file LuceneSearch.php.

deleteFromIndex ( PersistentObject  $obj)
See also
IndexedSearch::deleteFromIndex()

Implements IndexedSearch.

Definition at line 266 of file LuceneSearch.php.

stateChanged ( StateChangeEvent  $event)

Listen to StateChangeEvents.

Parameters
$eventStateChangeEvent instance

Definition at line 286 of file LuceneSearch.php.

getStopWords ( )
protected

Get a list of words that are forbidden to search for.

Returns
Array

Definition at line 338 of file LuceneSearch.php.