\ZendSearchLuceneWrapper
Provides a wrapper to Zend Search Lucene.
- Author: Darren Inwood <darren.inwood@chrometoaster.com>
Synopsis
class ZendSearchLuceneWrapper
{
- // members
- public static string $indexName = 'Silverstripe';
- private static boolean $index = false;
- private static array $createIndexCallbacks = ;
- private static boolean $extractorClasses = false;
- // methods
- public static Array find()
- public static Zend_Search_Lucene_Interface getIndex()
- public static void index()
- private static Array getTextExtractorClasses()
- public static void delete()
- private static Zend_Search_Lucene_Field getZendField()
- public static void getFieldValue()
- public static void addCreateIndexCallback()
- public static Integer rebuildIndex()
- public static void getAllIndexableObjects()
- protected static void getChildren()
Tasks
Line | Task |
---|---|
56+ | Add query logging |
Members
private
-
$createIndexCallbacks
Stores callbacks to be run after search index creation. -
$extractorClasses
The manifest of text extraction classes, in the order they should be run. -
$index
Stores a handle to the search index so we don't have to keep recreating it.
public
-
$indexName
The name of the index.
Methods
private
- getTextExtractorClasses() — Returns the list of available subclasses of ZendSearchLuceneTextExtractor in the order in which they should be processed. Order is determined by the $priority static on each class. Default is 100 for all inbuilt classes, lower numbers get run first.
- getZendField() — Builder method for returning a Zend_Search_Lucene_Field object based on the DataObject field.
protected
public
- addCreateIndexCallback() — Register a callback to run when creating an index. Useful for setting advanced index options. For example:
- delete() — Delete a DataObject from the search index.
- find() — Returns a set of results from Zend Search Lucene from the given search parameters.
- getAllIndexableObjects() — Returns a data array of all indexable DataObjects. For use when reindexing.
- getFieldValue() — Function to reduce a nested dot-notated field name to a string value.
- getIndex() — Retrieves a Zend_Search_Lucene_Interface object connected to the search index.
- index() — Indexes a DataObject.
- rebuildIndex() — Rebuilds the search index. Generally called via register_shutdown_function().