mirror of
https://github.com/YGGverse/Yo.git
synced 2026-04-01 02:05:29 +00:00
add crc32url filter
This commit is contained in:
parent
8a827bfcdf
commit
dfb2c06738
4 changed files with 44 additions and 25 deletions
|
|
@ -252,16 +252,19 @@ foreach($search->get() as $document)
|
|||
{
|
||||
foreach (array_unique($documents) as $url)
|
||||
{
|
||||
$url = trim($url);
|
||||
$url = trim($url);
|
||||
$crc32url = crc32($url);
|
||||
|
||||
if (!$index->search('@url "' . $url . '"')
|
||||
->filter('crc32url', $crc32url)
|
||||
->limit(1)
|
||||
->get()
|
||||
->getTotal())
|
||||
{
|
||||
$index->addDocument(
|
||||
[
|
||||
'url' => $url
|
||||
'url' => $url,
|
||||
'crc32url' => $crc32url
|
||||
]
|
||||
);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue