From 913a623e7ecafb0340c61e24a6715d7f1b46927b Mon Sep 17 00:00:00 2001 From: Matthias Richter Date: Mon, 7 Oct 2024 16:42:29 +0200 Subject: [PATCH 1/4] Do not index non final datasets --- Classes/Command/IndexCommand.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Classes/Command/IndexCommand.php b/Classes/Command/IndexCommand.php index 42449a7..22fc01b 100644 --- a/Classes/Command/IndexCommand.php +++ b/Classes/Command/IndexCommand.php @@ -787,7 +787,8 @@ protected function fetchObjects(): void if ($name == 'published_item') { $qb->where( - $eb->notLike('mvdb_id', $qb->createNamedParameter('AA%')) + $eb->notLike('mvdb_id', $qb->createNamedParameter('AA%')), + $eb->eq('final', 2) ); } From 7d02bfa865ec9b6bee937873e316e0ed864d325f Mon Sep 17 00:00:00 2001 From: Matthias Richter Date: Tue, 8 Oct 2024 19:24:33 +0200 Subject: [PATCH 2/4] Skip invalid nm relations when indexing --- Classes/Command/IndexCommand.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Classes/Command/IndexCommand.php b/Classes/Command/IndexCommand.php index 22fc01b..2298bce 100644 --- a/Classes/Command/IndexCommand.php +++ b/Classes/Command/IndexCommand.php @@ -862,7 +862,9 @@ protected function index(array $config, array $bufferedObject = null): array foreach($mmObjects as $object) { $subKey = $object[$subKeyField]; $superKey = $object[$superKeyField]; - $indexedObjects[$superKey][] = isset($subDataObjects[$subKey][0]) ? $subDataObjects[$subKey][0] : null; + if (isset($subDataObjects[$subKey][0])) { + $indexedObjects[$superKey][] = $subDataObjects[$subKey][0]; + } } } else { $subDataObjects = $bufferedObject ?? $this->dataObjects[$config['subObject']]; From 75855eb832bcf5029bfd697d0402a768579f0cf8 Mon Sep 17 00:00:00 2001 From: Matthias Richter Date: Wed, 9 Oct 2024 22:00:55 +0200 Subject: [PATCH 3/4] Dont index sorting symbols --- Classes/Command/IndexCommand.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Classes/Command/IndexCommand.php b/Classes/Command/IndexCommand.php index 2298bce..6302693 100644 --- a/Classes/Command/IndexCommand.php +++ b/Classes/Command/IndexCommand.php @@ -4,6 +4,7 @@ use Elastic\Elasticsearch\Client; use Illuminate\Support\Collection; +use Illuminate\Support\Str; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; @@ -793,11 +794,24 @@ protected function fetchObjects(): void } $data = $qb->execute()->fetchAll(); + if ($name == 'person') { + $data = Collection::wrap($data)-> + map(function ($person) { return self::removeSortingSymbols($person); }); + } $this->dataObjects[$name] = $data; } } + protected static function removeSortingSymbols(array $person): array + { + $name = Str::of($person['name'])-> + replace('˜', '')-> + replace('œ', ''); + $person['name'] = $name; + return $person; + } + /** * Executes an indexing sequence * From e74fda1e344eddf47ea43e07dc492448bee96b25 Mon Sep 17 00:00:00 2001 From: Matthias Richter Date: Wed, 9 Oct 2024 22:05:44 +0200 Subject: [PATCH 4/4] Adjust dependencies --- composer.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index da2a87f..77e77f1 100755 --- a/composer.json +++ b/composer.json @@ -14,7 +14,8 @@ "elasticsearch/elasticsearch": "^8", "slub/dm-ont": "@dev", "fluidtypo3/vhs": "^6", - "illuminate/collections": "^8" + "illuminate/collections": "^8", + "illuminate/support": "^8" }, "config": { "allow-plugins": {