Bugfix
This commit is contained in:
@@ -76,7 +76,10 @@ class MeilisearchIndexService
|
|||||||
|
|
||||||
private function indexTlSearchPdf($index): void
|
private function indexTlSearchPdf($index): void
|
||||||
{
|
{
|
||||||
$rows = $this->connection->fetchAllAssociative('SELECT * FROM tl_search_pdf');
|
$rows = $this->connection->fetchAllAssociative(
|
||||||
|
'SELECT * FROM tl_search_pdf'
|
||||||
|
);
|
||||||
|
|
||||||
if (!$rows) {
|
if (!$rows) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -84,7 +87,7 @@ class MeilisearchIndexService
|
|||||||
$documents = [];
|
$documents = [];
|
||||||
|
|
||||||
foreach ($rows as $row) {
|
foreach ($rows as $row) {
|
||||||
$fileType = in_array($row['type'], ['pdf','docx','xlsx','pptx'], true)
|
$fileType = in_array($row['type'], ['pdf', 'docx', 'xlsx', 'pptx'], true)
|
||||||
? $row['type']
|
? $row['type']
|
||||||
: 'pdf';
|
: 'pdf';
|
||||||
|
|
||||||
@@ -92,17 +95,14 @@ class MeilisearchIndexService
|
|||||||
'id' => $fileType . '_' . $row['id'],
|
'id' => $fileType . '_' . $row['id'],
|
||||||
'type' => $fileType,
|
'type' => $fileType,
|
||||||
'title' => $row['title'],
|
'title' => $row['title'],
|
||||||
'text' => $row['content'],
|
'text' => $row['text'], // ✅ korrekt
|
||||||
'url' => $row['url'],
|
'url' => $row['url'],
|
||||||
'pid' => $row['pid'],
|
|
||||||
'checksum' => $row['checksum'],
|
'checksum' => $row['checksum'],
|
||||||
'filesrc' => $row['filesrc'],
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
$index->addDocuments($documents);
|
$index->addDocuments($documents);
|
||||||
}
|
}
|
||||||
|
|
||||||
private function detectTypeFromMeta(?string $meta): string
|
private function detectTypeFromMeta(?string $meta): string
|
||||||
{
|
{
|
||||||
if (!$meta) {
|
if (!$meta) {
|
||||||
|
|||||||
Reference in New Issue
Block a user