Skip to content

Commit

Permalink
Merge pull request #122 from XIMDEX/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
FranEG80 authored Jan 10, 2025
2 parents 42e7fff + 343f5aa commit 2fb559a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion backend/app/Services/ResourceService.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
7 changes: 6 additions & 1 deletion backend/app/Services/Solr/SolrConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -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', []));
Expand Down
15 changes: 5 additions & 10 deletions backend/app/Services/Solr/SolrService.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down Expand Up @@ -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)){
Expand Down Expand Up @@ -477,12 +476,8 @@ private function executeSearchQuery($pageParams = [], $sortParams = [], $facetsF
$fields['data']->description->semantic_tags[$key] = $semanticData;
}
}

}


}

$documentsResponse[] = $fields;
}

Expand Down

0 comments on commit 2fb559a

Please sign in to comment.