From 93325a6bee3ab849f17823772fad7c165aa0b632 Mon Sep 17 00:00:00 2001 From: Simon Erkelens Date: Mon, 8 May 2023 13:51:30 +1200 Subject: [PATCH] Get the core file location from config When using Solr and Docker, it's common for files to actually live in a different location than where the instance path is. To overcome this, it's now possible to set the `solr_path`, as the path where the files should live according to Solr. --- src/Traits/CoreTraits/CoreAdminTrait.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Traits/CoreTraits/CoreAdminTrait.php b/src/Traits/CoreTraits/CoreAdminTrait.php index 0714a4d7..de67986d 100644 --- a/src/Traits/CoreTraits/CoreAdminTrait.php +++ b/src/Traits/CoreTraits/CoreAdminTrait.php @@ -50,7 +50,8 @@ public function coreCreate($core, $configStore): bool $action = $this->admin->createCreate(); $action->setCore($core); - $action->setInstanceDir($configStore->instanceDir($core)); + $path = SolrCoreService::config()->get('solr_path') ?? $configStore->instanceDir($core); + $action->setInstanceDir($path); $this->admin->setAction($action); try { $response = $this->client->coreAdmin($this->admin);