- Issue created by @joachim
hook_entity_view() is for any entity, and SearchAPI allows indexing all types of content entities.
However, the implementation of the hook, search_api_attachments_entity_view(), assumes the field for the entity ID is a node nid:
($query = \Drupal::entityTypeManager()
->getStorage('search_api_index')
->load($index->id())
->query()
)
->addCondition('nid', $entity->id());
Active
10.0
Code