|
|
@ -163,20 +163,36 @@ foreach($search->get() as $document) |
|
|
|
|
|
|
|
|
|
|
|
// Replace document |
|
|
|
// Replace document |
|
|
|
// https://github.com/manticoresoftware/manticoresearch-php/issues/10#issuecomment-612685916 |
|
|
|
// https://github.com/manticoresoftware/manticoresearch-php/issues/10#issuecomment-612685916 |
|
|
|
$index->replaceDocument( |
|
|
|
$data = |
|
|
|
[ |
|
|
|
[ |
|
|
|
'url' => $document->get('url'), |
|
|
|
'url' => $document->get('url'), |
|
|
|
'title' => $title, |
|
|
|
'title' => $title, |
|
|
|
'description' => $description, |
|
|
|
'description' => $description, |
|
|
|
'keywords' => $keywords, |
|
|
|
'keywords' => $keywords, |
|
|
|
'code' => $code, |
|
|
|
'code' => $code, |
|
|
|
'size' => $size, |
|
|
|
'size' => $size, |
|
|
|
'mime' => $mime, |
|
|
|
'mime' => $mime, |
|
|
|
'time' => time(), |
|
|
|
'time' => time() |
|
|
|
], |
|
|
|
]; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$result = $index->replaceDocument( |
|
|
|
|
|
|
|
$data, |
|
|
|
$document->getId() |
|
|
|
$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 |
|
|
|
// Crawl documents |
|
|
|
$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 |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
} |
|
|
|
} |