You are here

function search_api_elasticsearch_entity_presave in Search API Elasticsearch 7.2

Implements hook_entity_presave().

File

./search_api_elasticsearch.module, line 13
Provides an elasticsearch-based service class for the Search API.

Code

function search_api_elasticsearch_entity_presave($entity, $type) {
  if ($type == 'search_api_index') {
    if ($entity->is_new) {
      SearchApiElasticsearchIndex::setCurrentIndexName($entity);
    }
  }
}