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

bendev created an issue. See original summary.

drunken monkey’s picture

Component: General code » Drush / Rules
Status: Active » Needs review
StatusFileSize
new2.21 KB
new2.19 KB

You’re right, thanks a lot for noticing and reporting!
Let’s just fix this also in the Drush 9-style SearchApiCommands class. Also, I think it looks better to have the options before the argument?
Patch attached, please review!

bendev’s picture

Status: Needs review » Reviewed & tested by the community

ok I tested the refactored patch.
This is ok with me

  • drunken monkey committed 118ceda on 8.x-1.x authored by bendev
    Issue #3150764 by bendev, drunken monkey: Fixed documentation for Drush...
drunken monkey’s picture

Status: Reviewed & tested by the community » Fixed

Good to hear, thanks again for the patch and now for testing!
Committed.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.