mirror of
https://github.com/silverstripe/silverstripe-fulltextsearch
synced 2024-10-22 12:05:29 +00:00
Better feedback in Solr_Configure task
This commit is contained in:
parent
fd8c721799
commit
fefd704582
@ -152,6 +152,7 @@ class Solr_Reindex extends BuildTask {
|
|||||||
public function run($request) {
|
public function run($request) {
|
||||||
increase_time_limit_to();
|
increase_time_limit_to();
|
||||||
$self = get_class($this);
|
$self = get_class($this);
|
||||||
|
$verbose = isset($_GET['verbose']);
|
||||||
|
|
||||||
$originalState = SearchVariant::current_state();
|
$originalState = SearchVariant::current_state();
|
||||||
|
|
||||||
@ -187,7 +188,8 @@ class Solr_Reindex extends BuildTask {
|
|||||||
$total = $query->count();
|
$total = $query->count();
|
||||||
|
|
||||||
$statevar = json_encode($state);
|
$statevar = json_encode($state);
|
||||||
echo "Class: $class, total: $total in state $statevar\n";
|
echo "Class: $class, total: $total";
|
||||||
|
echo ($statevar) ? " in state $statevar\n" : "\n";
|
||||||
|
|
||||||
if (strpos(PHP_OS, "WIN") !== false) $statevar = '"'.str_replace('"', '\\"', $statevar).'"';
|
if (strpos(PHP_OS, "WIN") !== false) $statevar = '"'.str_replace('"', '\\"', $statevar).'"';
|
||||||
else $statevar = "'".$statevar."'";
|
else $statevar = "'".$statevar."'";
|
||||||
@ -196,11 +198,9 @@ class Solr_Reindex extends BuildTask {
|
|||||||
echo "$offset..";
|
echo "$offset..";
|
||||||
|
|
||||||
$cmd = "php $script dev/tasks/$self index=$index class=$class start=$offset variantstate=$statevar";
|
$cmd = "php $script dev/tasks/$self index=$index class=$class start=$offset variantstate=$statevar";
|
||||||
$res = `$cmd`;
|
if($verbose) echo "\n Running '$cmd'\n";
|
||||||
if (isset($_GET['verbose'])) {
|
$res = $verbose ? passthru($cmd) : `$cmd`;
|
||||||
echo "\n Running '$cmd'\n";
|
if($verbose) echo " ".preg_replace('/\r\n|\n/', '$0 ', $res)."\n";
|
||||||
echo " ".preg_replace('/\r\n|\n/', '$0 ', $res)."\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
// If we're in dev mode, commit more often for fun and profit
|
// If we're in dev mode, commit more often for fun and profit
|
||||||
if (Director::isDev()) Solr::service($index)->commit();
|
if (Director::isDev()) Solr::service($index)->commit();
|
||||||
@ -219,7 +219,6 @@ class Solr_Reindex extends BuildTask {
|
|||||||
$classes = $index->getClasses();
|
$classes = $index->getClasses();
|
||||||
$options = $classes[$class];
|
$options = $classes[$class];
|
||||||
|
|
||||||
echo "Variant: "; print_r($variantstate);
|
|
||||||
SearchVariant::activate_state($variantstate);
|
SearchVariant::activate_state($variantstate);
|
||||||
|
|
||||||
$includeSubclasses = $options['include_children'];
|
$includeSubclasses = $options['include_children'];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user