From 40792870bdfb78745c60857ae575a0cdacf262ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrgen=20Mummert?= Date: Sat, 10 Jan 2026 12:30:20 +0100 Subject: [PATCH] Tika Title encoding --- src/Command/MeilisearchFilesParseCommand.php | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/Command/MeilisearchFilesParseCommand.php b/src/Command/MeilisearchFilesParseCommand.php index 44e34df..32ad40d 100644 --- a/src/Command/MeilisearchFilesParseCommand.php +++ b/src/Command/MeilisearchFilesParseCommand.php @@ -77,7 +77,7 @@ class MeilisearchFilesParseCommand extends Command $normalized = $originalUrl; // ------------------------------------------------- - // Normalize URL → files/… + // Normalize URL // ------------------------------------------------- if (str_contains($normalized, '?')) { $parts = parse_url($normalized); @@ -173,7 +173,7 @@ class MeilisearchFilesParseCommand extends Command } // ------------------------------------------------- - // Tika METADATA (Titel) + // Tika METADATA (Title) // ------------------------------------------------- $title = null; @@ -208,7 +208,17 @@ class MeilisearchFilesParseCommand extends Command } } catch (\Throwable) { - // Titel ist optional + // Metadata optional + } + + // ------------------------------------------------- + // TITLE FALLBACK (REQUIRED) + // ------------------------------------------------- + if (!$title) { + $title = pathinfo($normalized, PATHINFO_FILENAME); + $title = str_replace(['_', '-'], ' ', $title); + $title = preg_replace('/\s+/u', ' ', $title); + $title = trim($title); } // -------------------------------------------------