mirror of
https://github.com/silverstripe/silverstripe-fulltextsearch
synced 2024-10-22 12:05:29 +00:00
Merge pull request #155 from BrewCurious/master
Adding extension hooks before and after Solr tasks
This commit is contained in:
commit
fc57daa45a
@ -227,6 +227,8 @@ class Solr_Configure extends Solr_BuildTask
|
||||
{
|
||||
parent::run($request);
|
||||
|
||||
$this->extend('updateBeforeSolrConfigureTask', $request);
|
||||
|
||||
// Find the IndexStore handler, which will handle uploading config files to Solr
|
||||
$store = $this->getSolrConfigStore();
|
||||
$indexes = Solr::get_indexes();
|
||||
@ -244,6 +246,8 @@ class Solr_Configure extends Solr_BuildTask
|
||||
if (isset($e)) {
|
||||
exit(1);
|
||||
}
|
||||
|
||||
$this->extend('updateAfterSolrConfigureTask', $request);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -346,10 +350,14 @@ class Solr_Reindex extends Solr_BuildTask
|
||||
{
|
||||
parent::run($request);
|
||||
|
||||
$this->extend('updateBeforeSolrReindexTask', $request);
|
||||
|
||||
// Reset state
|
||||
$originalState = SearchVariant::current_state();
|
||||
$this->doReindex($request);
|
||||
SearchVariant::activate_state($originalState);
|
||||
|
||||
$this->extend('updateAfterSolrReindexTask', $request);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user