add crc32url filter

This commit is contained in:
ghost 2023-11-25 18:10:23 +02:00
parent 8a827bfcdf
commit dfb2c06738
4 changed files with 44 additions and 25 deletions

View file

@ -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
]
);