add cleanup limit argument

This commit is contained in:
yggverse 2024-03-21 18:41:33 +02:00
parent e635ec6dc9
commit 79b82d46e1
2 changed files with 13 additions and 3 deletions

View File

@ -99,11 +99,13 @@ php src/cli/document/crawl.php
##### Clean
Make index optimization, apply new configuration rules
```
php src/cli/document/clean.php
php src/cli/document/clean.php [limit]
```
* make index optimization
* `limit` - integer, documents quantity per queue
##### Search

View File

@ -79,7 +79,15 @@ foreach ($config->cli->document->crawl->skip->stripos->url as $condition)
$documents = 0;
$snaps = 0;
foreach($index->search(sprintf('@url "%s"', $condition))->get() as $document)
foreach(
$index->search(
sprintf(
'@url "%s"',
$condition
)
)->limit(
isset($argv[1]) ? (int) $argv[1] : 10
)->get() as $document)
{
// Delete found document by it ID
$result = $index->deleteDocument(