From 1a36ef465dfa0d3911e7e607fb5e4d1a8384ef2c Mon Sep 17 00:00:00 2001 From: juandz13 Date: Thu, 9 Jan 2025 12:24:19 +0100 Subject: [PATCH 1/3] bugfix empty version --- backend/app/Services/Solr/SolrConfig.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/backend/app/Services/Solr/SolrConfig.php b/backend/app/Services/Solr/SolrConfig.php index 3aadc558..1dfa540a 100644 --- a/backend/app/Services/Solr/SolrConfig.php +++ b/backend/app/Services/Solr/SolrConfig.php @@ -210,7 +210,12 @@ public function cleanDocuments(array $excludedCores, $action, $solrVersion): str //exclude cores $clientCoreName = $client->getEndpoint()->getOptions()['core']; $aliasClient = $this->getClientCoreAlias($clientCoreName); - + if (!empty($solrVersion)) { + $aliasClient = array_map(function ($auxClientCoreNames, $clientName) use ($solrVersion) { + return [$clientName . "_$solrVersion" => $auxClientCoreNames]; + }, $aliasClient, array_keys($aliasClient)); + $aliasClient = call_user_func_array('array_merge', $aliasClient); + } $isValid = false; foreach ($aliasClient[$clientCoreName] as $auxClientCoreName) { $isValid = !$isValid && array_key_exists($auxClientCoreName, config('solarium.connections', [])); From 7bdeaf38d32a00054d3423d377250e38c76f5c75 Mon Sep 17 00:00:00 2001 From: juandz13 Date: Thu, 9 Jan 2025 12:24:46 +0100 Subject: [PATCH 2/3] bugfix lom data not longer set on resource update --- backend/app/Services/ResourceService.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/app/Services/ResourceService.php b/backend/app/Services/ResourceService.php index 0d6b6be4..89a4e2e3 100644 --- a/backend/app/Services/ResourceService.php +++ b/backend/app/Services/ResourceService.php @@ -400,7 +400,7 @@ public function update(DamResource $resource, $params, $availableSizes): DamReso $resource->data->description->semantic_tags ); }*/ - $this->setLomData($resource, $lom_params); + // $this->setLomData($resource, $lom_params); } $this->saveAssociatedFiles($resource, $params, $availableSizes); From 8115bb64c71f26ee1a54b878fe9d9b4e7af68f6d Mon Sep 17 00:00:00 2001 From: juandz13 Date: Fri, 10 Jan 2025 10:47:08 +0100 Subject: [PATCH 3/3] lomes bugfix --- backend/app/Services/Solr/SolrService.php | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/backend/app/Services/Solr/SolrService.php b/backend/app/Services/Solr/SolrService.php index 995e32cf..4ae6c73b 100644 --- a/backend/app/Services/Solr/SolrService.php +++ b/backend/app/Services/Solr/SolrService.php @@ -227,15 +227,15 @@ public function saveOrUpdateDocument( // Checks if the LOM and the LOMES must be updated if ($reindexLOM) { - // Gets the LOM and the LOMES client - $lomClient = $this->getClient($lomCoreName); - $lomesClient = $this->getClient($lomesCoreName); + // // Gets the LOM and the LOMES client + $lomClient = $this->getClient('lom'); + $lomesClient = $this->getClient('lomes'); - // Gets the LOM and the LOMES items + // // Gets the LOM and the LOMES items $lomItem = Lom::where('dam_resource_id', $damResource->id)->first(); $lomesItem = Lomes::where('dam_resource_id', $damResource->id)->first(); - // Manages the LOM and LOMES documents + // // Manages the LOM and LOMES documents $this->saveLOMDocuments($lomClient, $lomItem, Utils::getLomSchema(true), $damResource); $this->saveLOMDocuments($lomesClient, $lomesItem, Utils::getLomesSchema(true), $damResource); } @@ -439,7 +439,6 @@ private function executeSearchQuery($pageParams = [], $sortParams = [], $facetsF foreach ($fields['files'] as $file) { $last_uuid = substr($file, strrpos($file, "@",-4)); $last_uuid= str_replace("@", "", $last_uuid); - if (Storage::disk("semantic")->exists($fields["id"]."/".$last_uuid.".json")) { $json = json_decode(Storage::disk("semantic")->get($fields["id"]."/".$last_uuid.".json")); if(isset($json->xtags_interlinked)){ @@ -477,12 +476,8 @@ private function executeSearchQuery($pageParams = [], $sortParams = [], $facetsF $fields['data']->description->semantic_tags[$key] = $semanticData; } } - } - - } - $documentsResponse[] = $fields; }