- also update solr index in EditorController.php and DoiController.php

- composer updates
This commit is contained in:
Arno Kaimbacher 2021-06-10 11:53:45 +02:00
parent 604e6ba8d7
commit d80a8ab3f4
3 changed files with 24 additions and 12 deletions

View file

@ -11,6 +11,8 @@ use App\Models\Oai\OaiModelError;
use App\Exceptions\OaiModelException;
use Illuminate\Support\Facades\View;
use App\Exceptions\GeneralException;
use App\Library\Search\SolariumAdapter;
use \Exception;
class DoiController extends Controller
{
@ -233,6 +235,12 @@ class DoiController extends Controller
// $doi['status'] = "findable";
// $doi->save();
$doi->touch();
try {
$service = new SolariumAdapter("solr", config('solarium'));
$service->addDatasetsToIndex($dataset);
} catch (Exception $e) {
$this->error(__METHOD__ . ': ' . 'Indexing document ' . $dataset->id . ' failed: ' . $e->getMessage());
}
return redirect()
->route('publish.workflow.doi.index')
->with('flash_message', 'You have successfully updated a DOI for the dataset!');