mirror of
https://github.com/silverstripe/silverstripe-fulltextsearch
synced 2024-10-22 12:05:29 +00:00
Fix issue where schema.xml etc is put in a different dir than the core is instantiated in
This commit is contained in:
parent
48f3df725a
commit
b6e64a2ec4
@ -3,6 +3,7 @@
|
|||||||
namespace SilverStripe\FullTextSearch\Solr;
|
namespace SilverStripe\FullTextSearch\Solr;
|
||||||
|
|
||||||
use SilverStripe\Control\Director;
|
use SilverStripe\Control\Director;
|
||||||
|
use SilverStripe\Core\ClassInfo;
|
||||||
use SilverStripe\Core\Environment;
|
use SilverStripe\Core\Environment;
|
||||||
use SilverStripe\FulltextSearch\Search\Indexes\SearchIndex;
|
use SilverStripe\FulltextSearch\Search\Indexes\SearchIndex;
|
||||||
use SilverStripe\FullTextSearch\Search\Variants\SearchVariant_Caller;
|
use SilverStripe\FullTextSearch\Search\Variants\SearchVariant_Caller;
|
||||||
@ -1051,9 +1052,12 @@ abstract class SolrIndex extends SearchIndex
|
|||||||
*/
|
*/
|
||||||
public function uploadConfig($store)
|
public function uploadConfig($store)
|
||||||
{
|
{
|
||||||
|
// Ensure the short class name is used to match the call which creates the core in SolrService->coreCreate()
|
||||||
|
$indexName = self::getClassNameFromIndex($this->getIndexName());
|
||||||
|
$indexName = ClassInfo::shortName($indexName);
|
||||||
// Upload the config files for this index
|
// Upload the config files for this index
|
||||||
$store->uploadString(
|
$store->uploadString(
|
||||||
$this->getIndexName(),
|
$indexName,
|
||||||
'schema.xml',
|
'schema.xml',
|
||||||
(string)$this->generateSchema()
|
(string)$this->generateSchema()
|
||||||
);
|
);
|
||||||
@ -1061,7 +1065,7 @@ abstract class SolrIndex extends SearchIndex
|
|||||||
// Upload additional files
|
// Upload additional files
|
||||||
foreach (glob($this->getExtrasPath().'/*') as $file) {
|
foreach (glob($this->getExtrasPath().'/*') as $file) {
|
||||||
if (is_file($file)) {
|
if (is_file($file)) {
|
||||||
$store->uploadFile($this->getIndexName(), $file);
|
$store->uploadFile($indexName, $file);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user