Browse Source

add cleanup limit argument

main
yggverse 8 months ago
parent
commit
79b82d46e1
  1. 6
      README.md
  2. 10
      src/cli/document/clean.php

6
README.md

@ -99,11 +99,13 @@ php src/cli/document/crawl.php
##### Clean ##### 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 ##### Search

10
src/cli/document/clean.php

@ -79,7 +79,15 @@ foreach ($config->cli->document->crawl->skip->stripos->url as $condition)
$documents = 0; $documents = 0;
$snaps = 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 // Delete found document by it ID
$result = $index->deleteDocument( $result = $index->deleteDocument(

Loading…
Cancel
Save