\SolrIndexable
A decorator that adds the ability to index a DataObject in Solr
- Author: Marcus Nyeholt <marcus@silverstripe.com.au>
- License: http://silverstripe.org/bsd-license/
Synopsis
class SolrIndexable
extends DataExtension
{
- // members
- public static boolean $indexing = true;
- public static boolean $index_draft = true;
- public static array $dependencies = ;
- public static array $db = ;
- // methods
- protected void createIndexJob()
- public void onAfterPublish()
- public void onBeforeWrite()
- public void onAfterWrite()
- public void canShowInSearch()
- public onAfterUnpublish()
- public void onAfterDelete()
- public void reindex()
Hierarchy
Extends
- DataExtension
Members
public
- $db
- $dependencies — array
- $index_draft
—
boolean
Should we index draft content too? - $indexing
—
boolean
We might not want to index, eg during a data load
Methods
protected
public
- canShowInSearch()
- onAfterDelete()
- onAfterPublish() — Index after publish
- onAfterUnpublish() — If unpublished, we delete from the index then reindex the 'stage' version of the content
- onAfterWrite() — Index after every write; this lets us search on Draft data as well as live data
- onBeforeWrite()
- reindex() — Index the current data object for a particular stage.