Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
It doesn't look like there is any code setting up the dispatch for the listed tasks:
search_api.task.addIndex
search_api.task.updateIndex
search_api.task.removeIndex
search_api.task.deleteItems
search_api.task.deleteAllIndexItems
Right now I'm most interested in search_api.task.addIndex so I can alter the mapping going into Elasticsearch backend.
Within search_api\src\Task\TaskManager.php, the only operation I'm seeing happen is the search_api.task.trackItems once I've created an index.
public function executeSpecificTask(TaskInterface $task) {
$event = new TaskEvent($task);
$this->eventDispatcher->dispatch('search_api.task.' . $task->getType(), $event);
Comments
Comment #2
drunken monkeyI'm pretty sure those events aren't what you think they are. I think you want to use the associated hooks instead.
The events you list are just used internally by the server tasks manager – and those tasks are only created if the backend method of the same name fails, so it will be tried again later. If your search server works, those will never be used.