diff --git a/README.md b/README.md index 02529eb..aa4b86a 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/src/cli/document/clean.php b/src/cli/document/clean.php index 1fc9655..9b64c46 100644 --- a/src/cli/document/clean.php +++ b/src/cli/document/clean.php @@ -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(