mirror of
https://github.com/YGGverse/Yo.git
synced 2025-01-29 16:04:20 +00:00
add cleanup limit argument
This commit is contained in:
parent
e635ec6dc9
commit
79b82d46e1
@ -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
|
||||
|
||||
|
@ -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(
|
||||
|
Loading…
x
Reference in New Issue
Block a user