From 7cf10079c6c5f14a4a218ca1acb8cee5c6034c8d Mon Sep 17 00:00:00 2001 From: yggverse Date: Sat, 23 Mar 2024 03:31:27 +0200 Subject: [PATCH] update mime on progress function event --- src/cli/document/crawl.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/cli/document/crawl.php b/src/cli/document/crawl.php index 7be064c..2f1d102 100644 --- a/src/cli/document/crawl.php +++ b/src/cli/document/crawl.php @@ -203,11 +203,19 @@ foreach($index->search('') $upload, $uploaded ) { + global $request; + global $index; global $document; + if (!$mime = curl_getinfo($request, CURLINFO_CONTENT_TYPE)) + { + $mime = $document->get('mime'); + } + $index->updateDocument( [ + 'mime' => $mime, 'time' => time(), 'code' => 200, 'index' => 0