It seems that currently, when we create an index, or add a new datasource to it, and the index has "index items immediately" enabled, all items (of the new datasource) are immediately indexed. Which was neither the D7 behavior, nor is it appropriate, I think.

The flow is currently: postSave() -> reactToDatasourceSwitch() -> trackItemsInserted(), and the last of course reacts the same way as it would when just the item is new, not the index itself (or the datasource on the index).

I'm pretty sure we need to fix this, otherwise larger sites will need to use a workaround for creating indexes with "index items immediately" (or enabling new datasources for them).

Comments

drunken monkey’s picture

Project: Search API (8.x) » Search API
Version: » 8.x-1.x-dev
drunken monkey’s picture

Status: Active » Closed (duplicate)

Unless I'm mistaken, this was fixed as a side-effect of #2253831: Make sure adding items to the tracking table for new indexes is scalable.
It will still occur when enabling new bundles for a datasource, but that will be solved by #2574611: Unify our two task systems.