As soon as you run drush sapi-i once, it's impossible to mark an index to be reindexed again. It doesn't matter if you try it via drush sapi-r pr via the UI. This issue persists until you rebuild the caches, for example using drush cr.

I didn't debug the issue completely yet but it seems that this isn't triggered correctly via drush sapi-i:

\Drupal::state()->set("search_api.index.$id.has_reindexed", $has_reindexed);

Comments

mkalkbrenner created an issue. See original summary.

drunken monkey’s picture

Status: Active » Postponed (maintainer needs more info)

Sorry, but I can't reproduce this problem. I also don't see how it could happen, as long as Drush doesn't mess up the site state in some way in general, since the proper state is set from right within the Index::indexSpecificItems() method – and will therefore run regardless of where the indexing request originated.
Please verify that you don't have some custom setup which interferes here and try to debug what exactly goes wrong.

mkalkbrenner’s picture

Sure, this needs some more debugging. I just wanted to document the issue first :-)

greggles’s picture

Category: Bug report » Support request
Status: Postponed (maintainer needs more info) » Fixed

@mkalkbrenner - were you able to resolve this issue? I'm assuming so and that it wasn't a bug so marking it as a fixed support request. Feel free to reopen if that is wrong.

mkalkbrenner’s picture

I tested again and could not reproduce the issue anymore.

Status: Fixed » Closed (fixed)

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