mirror of
https://github.com/YGGverse/Yo.git
synced 2026-04-01 02:05:29 +00:00
set crc32url as document id
This commit is contained in:
parent
93baed4b90
commit
6f4abe4729
7 changed files with 25 additions and 73 deletions
|
|
@ -29,7 +29,7 @@ $crc32url = crc32($url);
|
|||
|
||||
// Check URL for exist
|
||||
$result = $index->search('')
|
||||
->filter('crc32url', $crc32url)
|
||||
->filter('id', $crc32url)
|
||||
->limit(1)
|
||||
->get();
|
||||
|
||||
|
|
@ -47,9 +47,9 @@ if ($result->getTotal())
|
|||
// Add
|
||||
$result = $index->addDocument(
|
||||
[
|
||||
'url' => $url,
|
||||
'crc32url' => $crc32url
|
||||
]
|
||||
'url' => $url
|
||||
],
|
||||
$crc32url
|
||||
);
|
||||
|
||||
echo sprintf(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue