set crc32url as document id

This commit is contained in:
ghost 2024-01-22 22:52:37 +02:00
parent 93baed4b90
commit 6f4abe4729
7 changed files with 25 additions and 73 deletions

View file

@ -128,7 +128,7 @@ for ($i = 0; $i <= $total; $i++)
if (isset($argv[6]))
{
$local = $index->search('')
->filter('crc32url', $crc32url)
->filter('id', $crc32url)
->limit(1)
->get();
@ -149,7 +149,6 @@ for ($i = 0; $i <= $total; $i++)
$index->addDocument(
[
'url' => $url,
'crc32url' => (int) $crc32url,
'time' => (int) $remote->timeUpdated,
'code' => (int) $remote->httpCode,
'size' => (int) $remote->size,
@ -157,7 +156,8 @@ for ($i = 0; $i <= $total; $i++)
'title' => (string) $remote->title,
'description' => (string) $remote->description,
'keywords' => (string) $remote->keywords
]
],
(int) $crc32url
);
// Result