mirror of
https://github.com/YGGverse/Yo.git
synced 2025-02-05 19:34:14 +00:00
make sure document contain exact substring in URL
This commit is contained in:
parent
22c73fb922
commit
be7c63e68a
@ -83,12 +83,20 @@ foreach ($config->cli->document->crawl->skip->stripos->url as $condition)
|
||||
$index->search(
|
||||
sprintf(
|
||||
'@url "%s"',
|
||||
$condition
|
||||
@\Manticoresearch\Utils::escape(
|
||||
$condition
|
||||
)
|
||||
)
|
||||
)->limit(
|
||||
isset($argv[1]) ? (int) $argv[1] : 10
|
||||
)->get() as $document)
|
||||
{
|
||||
// Make sure document contain exact substring in URL
|
||||
if (false === mb_strpos($document->get('url'), $condition))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
// Delete found document by it ID
|
||||
$result = $index->deleteDocument(
|
||||
$document->getId()
|
||||
|
Loading…
x
Reference in New Issue
Block a user