wCMF
3.6
|
Static Public Member Functions | |
static | getIndex ($create=true) |
static | resetIndex () |
static | indexInSearch (&$obj) |
static | deleteFromSearch (&$obj) |
static | commitIndex ($optimize=true) |
static | optimizeIndex () |
static | isActivated () |
static | getStopWords () |
static | find ($searchTerm, &$pagingInfo) |
Public Attributes | |
const | INI_SECTION = 'search' |
const | INI_INDEX_PATH = 'indexPath' |
Static Private Member Functions | |
static | encodeValue ($value, $inputType) |
static | getIndexPath () |
Static Private Attributes | |
static | $isActivated = null |
static | $index |
static | $indexPath |
static | $indexIsDirty = false |
This class provides access to the search based on Zend_Search_Lucene. The search index stored in the location that is defined by the configuration key 'indexPath' in the configuration section 'search'. To manage PersistentObjects in the index use the methods SearchUtil::indexInSearch() and SearchIndex::deleteFromSearch() and SearchUtil::commitIndex(). The method SearchUtil::getIndex() offers direct access to the search index for advanced operations.
Definition at line 37 of file class.SearchUtil.php.
|
static |
Get the search index.
create | Boolean whether to create the index, if it does not exist [default: true] |
Definition at line 52 of file class.SearchUtil.php.
References $indexPath.
|
static |
Reset the search index.
Definition at line 89 of file class.SearchUtil.php.
References $indexPath.
Referenced by SearchIndexController\getWorkPackage().
|
static |
Add a PersistentObject instance to the search index. This method modifies the index. For that reason SearchUtil::commitIndex() should be called afterwards.
obj | The PersistentObject instance. |
Definition at line 103 of file class.SearchUtil.php.
References $index, and DATATYPE_ATTRIBUTE.
Referenced by SearchIndexController\index(), and PersistentObject\save().
|
staticprivate |
Definition at line 146 of file class.SearchUtil.php.
|
static |
Delete a PersistentObject instance from the search index.
obj | The PersistentObject instance. |
Definition at line 158 of file class.SearchUtil.php.
References $index.
Referenced by PersistentObject\delete().
|
static |
Commit any changes made by using SearchUtil::indexInSearch() and SearchIndex::deleteFromSearch().
optimize | Boolean whether the index should be optimized after commit [default: true]. |
Definition at line 182 of file class.SearchUtil.php.
References $index.
Referenced by SearchIndexController\index().
|
static |
Optimize the index
Definition at line 202 of file class.SearchUtil.php.
References $index.
Referenced by SearchIndexController\optimize().
|
staticprivate |
Get the path to the index.
Definition at line 217 of file class.SearchUtil.php.
References Log\debug(), Log\error(), InifileParser\getInstance(), and FileUtil\mkdirRec().
|
static |
Check if a index path is defined in the configuration.
Definition at line 248 of file class.SearchUtil.php.
References InifileParser\getInstance().
Referenced by SearchIndexController\getWorkPackage().
|
static |
Get a list of words that are forbidden to search for
Definition at line 261 of file class.SearchUtil.php.
References $GLOBALS.
|
static |
Search for searchTerm in index
searchTerm | |
pagingInfo |
Definition at line 273 of file class.SearchUtil.php.
References $index, BUILDDEPTH_SINGLE, DATATYPE_ATTRIBUTE, StringUtil\excerpt(), and PersistenceFacade\getInstance().
Referenced by SearchController\getObjects().
const SearchUtil::INI_SECTION = 'search' |
Definition at line 39 of file class.SearchUtil.php.
const SearchUtil::INI_INDEX_PATH = 'indexPath' |
Definition at line 40 of file class.SearchUtil.php.
|
staticprivate |
Definition at line 42 of file class.SearchUtil.php.
|
staticprivate |
Definition at line 43 of file class.SearchUtil.php.
Referenced by commitIndex(), deleteFromSearch(), find(), indexInSearch(), and optimizeIndex().
|
staticprivate |
Definition at line 44 of file class.SearchUtil.php.
Referenced by getIndex(), and resetIndex().
|
staticprivate |
Definition at line 45 of file class.SearchUtil.php.