This commit is contained in:
Jürgen Mummert
2025-12-31 12:31:05 +01:00
parent 41c9db954d
commit 71f8d2cc95
@@ -37,6 +37,21 @@ class MeilisearchPageMarkerListener
}
}
/*
* =====================
* KEYWORDS AUS FRONTEND (Catalog Manager)
* =====================
*/
$frontendKeywords = [];
if (preg_match(
'#<div[^>]+id=["\']keywords["\'][^>]+meilisearch-keywords=["\']([^"\']+)["\']#i',
$buffer,
$m
)) {
$frontendKeywords = preg_split('/\s+/', trim($m[1]));
}
/*
* =====================
* PAGE (Basisdaten)
@@ -150,6 +165,48 @@ class MeilisearchPageMarkerListener
}
}
/*
* =====================
* KEYWORDS ZUSAMMENFÜHREN
* =====================
*/
$allKeywords = [];
if (!empty($data['page']['keywords'])) {
$allKeywords = array_merge(
$allKeywords,
preg_split('/\s+/', $data['page']['keywords'])
);
}
if (!empty($data['event']['keywords'])) {
$allKeywords = array_merge(
$allKeywords,
preg_split('/\s+/', $data['event']['keywords'])
);
}
if (!empty($data['news']['keywords'])) {
$allKeywords = array_merge(
$allKeywords,
preg_split('/\s+/', $data['news']['keywords'])
);
}
if (!empty($frontendKeywords)) {
$allKeywords = array_merge($allKeywords, $frontendKeywords);
}
$allKeywords = array_unique(
array_filter(
array_map('trim', $allKeywords)
)
);
if ($allKeywords !== []) {
$data['page']['keywords'] = implode(' ', $allKeywords);
}
/*
* =====================
* FINALE SEARCHIMAGE-ENTSCHEIDUNG
@@ -157,7 +214,6 @@ class MeilisearchPageMarkerListener
*/
$finalSearchImageUuid = null;
// 🔥 TOP-PRIORITÄT: Content-Bild
if ($contentImageUuid !== null) {
$finalSearchImageUuid = $contentImageUuid;
}
@@ -205,7 +261,6 @@ class MeilisearchPageMarkerListener
if ($contentImageUuid) {
$metaParts[] = 'content_searchimage=' . $contentImageUuid;
}
if (!empty($data['event']['startDate'])) {
$metaParts[] = 'event_startDate=' . $data['event']['startDate'];
}