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 *