Bugfix
This commit is contained in:
@@ -14,18 +14,8 @@ class IndexPageListener
|
|||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* =====================================================
|
* =====================================================
|
||||||
* PDF-Indexierung global deaktiviert?
|
* IMMER: Service einmal pro Crawl initialisieren
|
||||||
* → sofort raus, nichts anfassen
|
* + Tabelle initial leeren (auch wenn Feature später deaktiviert wurde)
|
||||||
* =====================================================
|
|
||||||
*/
|
|
||||||
if (!Config::get('meilisearch_index_pdfs')) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* =====================================================
|
|
||||||
* PDF-Service einmal pro Crawl initialisieren
|
|
||||||
* + Tabelle initial leeren
|
|
||||||
* =====================================================
|
* =====================================================
|
||||||
*/
|
*/
|
||||||
if ($this->pdfIndexService === null) {
|
if ($this->pdfIndexService === null) {
|
||||||
@@ -33,6 +23,16 @@ class IndexPageListener
|
|||||||
$this->pdfIndexService->resetTableOnce();
|
$this->pdfIndexService->resetTableOnce();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* =====================================================
|
||||||
|
* PDF-Indexierung global deaktiviert?
|
||||||
|
* → ab hier nichts mehr tun (aber Reset ist schon passiert)
|
||||||
|
* =====================================================
|
||||||
|
*/
|
||||||
|
if (!Config::get('meilisearch_index_pdfs')) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Marker vorhanden?
|
// Marker vorhanden?
|
||||||
if (!str_contains($content, 'MEILISEARCH_JSON')) {
|
if (!str_contains($content, 'MEILISEARCH_JSON')) {
|
||||||
return;
|
return;
|
||||||
@@ -127,9 +127,6 @@ class IndexPageListener
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* =====================================================
|
|
||||||
* JSON aus Marker extrahieren
|
|
||||||
* ===================================================== */
|
|
||||||
private function extractMeilisearchJson(string $content): ?array
|
private function extractMeilisearchJson(string $content): ?array
|
||||||
{
|
{
|
||||||
if (!preg_match('/<!--\s*MEILISEARCH_JSON\s*(\{.*?\})\s*-->/s', $content, $m)) {
|
if (!preg_match('/<!--\s*MEILISEARCH_JSON\s*(\{.*?\})\s*-->/s', $content, $m)) {
|
||||||
@@ -142,9 +139,6 @@ class IndexPageListener
|
|||||||
return is_array($data) ? $data : null;
|
return is_array($data) ? $data : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* =====================================================
|
|
||||||
* PDF-Links + Linktext aus HTML extrahieren
|
|
||||||
* ===================================================== */
|
|
||||||
private function findPdfLinks(string $content): array
|
private function findPdfLinks(string $content): array
|
||||||
{
|
{
|
||||||
if (!preg_match_all(
|
if (!preg_match_all(
|
||||||
|
|||||||
Reference in New Issue
Block a user