mirror of
https://github.com/silverstripe/silverstripe-fulltextsearch
synced 2024-10-22 14:05:29 +02:00
fixes to allow namespacing in index class
This commit is contained in:
parent
3fe285aaf1
commit
d7805f46ab
@ -59,10 +59,12 @@ class SolrReindexImmediateHandler extends SolrReindexBase
|
||||
// Build script
|
||||
$indexName = $indexInstance->getIndexName();
|
||||
$indexClass = get_class($indexInstance);
|
||||
$indexClassEscaped = addslashes($indexClass);
|
||||
$class = addslashes($class);
|
||||
$scriptPath = sprintf("%s%sframework%scli-script.php", BASE_PATH, DIRECTORY_SEPARATOR, DIRECTORY_SEPARATOR);
|
||||
$scriptTask = "php {$scriptPath} dev/tasks/{$taskName}";
|
||||
$cmd = "{$scriptTask} index={$indexClass} class={$class} group={$group} groups={$groups} variantstate={$statevar}";
|
||||
|
||||
$cmd = "{$scriptTask} index={$indexClassEscaped} class={$class} group={$group} groups={$groups} variantstate={$statevar}";
|
||||
$cmd .= " verbose=1 2>&1";
|
||||
$logger->info("Running '$cmd'");
|
||||
|
||||
|
@ -84,6 +84,7 @@ class SolrService extends SolrService_Core
|
||||
public function serviceForCore($core)
|
||||
{
|
||||
$klass = Config::inst()->get(get_called_class(), 'core_class');
|
||||
return new $klass($this->_host, $this->_port, $this->_path.$core, $this->_httpTransport);
|
||||
$coreName = ClassInfo::shortName($core);
|
||||
return new $klass($this->_host, $this->_port, $this->_path . $coreName, $this->_httpTransport);
|
||||
}
|
||||
}
|
||||
|
@ -3,6 +3,7 @@ namespace SilverStripe\FullTextSearch\Solr\Tasks;
|
||||
use ReflectionClass;
|
||||
use SilverStripe\Core\ClassInfo;
|
||||
use SilverStripe\Core\Injector\Injector;
|
||||
use SilverStripe\Dev\Debug;
|
||||
use SilverStripe\FullTextSearch\Search\Variants\SearchVariant;
|
||||
use SilverStripe\ORM\DataList;
|
||||
use SilverStripe\FullTextSearch\Solr\Reindex\Handlers\SolrReindexHandler;
|
||||
|
Loading…
Reference in New Issue
Block a user