fix debug output

This commit is contained in:
ghost 2023-11-19 23:34:13 +02:00
parent 7dfc800a67
commit 13cf61b42c

View File

@ -163,20 +163,36 @@ foreach($search->get() as $document)
// Replace document
// https://github.com/manticoresoftware/manticoresearch-php/issues/10#issuecomment-612685916
$index->replaceDocument(
[
'url' => $document->get('url'),
'title' => $title,
'description' => $description,
'keywords' => $keywords,
'code' => $code,
'size' => $size,
'mime' => $mime,
'time' => time(),
],
$data =
[
'url' => $document->get('url'),
'title' => $title,
'description' => $description,
'keywords' => $keywords,
'code' => $code,
'size' => $size,
'mime' => $mime,
'time' => time()
];
$result = $index->replaceDocument(
$data,
$document->getId()
);
echo sprintf(
'index "%s" updated: %s %s' . PHP_EOL,
$config->manticore->index->document,
print_r(
$result,
true
),
print_r(
$data,
true
),
);
// Crawl documents
$documents = [];
@ -257,13 +273,4 @@ foreach($search->get() as $document)
}
}
}
echo sprintf(
'index "%s" updated: %s' . PHP_EOL,
$config->manticore->index->document,
print_r(
$document,
true
)
);
}