Trying to index nodes with drush, I needed to limit the number of items indexed at once to cope with size and performance issues.
Following the documentation I tried the commands
drush sapi-i node_index 100
drush sapi-i node_index 100 1
but got error:
In DrushArgvInput.php line 192:
[Symfony\Component\Console\Exception\RuntimeException]
Too many arguments, expected arguments "command" "indexId".
drush version 9.7.1
Using this format is working like a charm
drush sapi-i node_index --limit=100
drush sapi-i node_index --limit=100 --batch-size=10
I don't know if this is a code or documentation issue.
I adapted the documentation as in the patch
Comments
Comment #2
drunken monkeyYou’re right, thanks a lot for noticing and reporting!
Let’s just fix this also in the Drush 9-style
SearchApiCommandsclass. Also, I think it looks better to have the options before the argument?Patch attached, please review!
Comment #3
bendev commentedok I tested the refactored patch.
This is ok with me
Comment #5
drunken monkeyGood to hear, thanks again for the patch and now for testing!
Committed.