You are here

function audit_log_elastic_search_create_type in Audit Log 7

Create Elasticsearch watchdog type.

1 call to audit_log_elastic_search_create_type()
audit_log_elastic_search_settings_validate in modules/audit_log_elastic_search/audit_log_elastic_search.admin.inc
Validate the setting form submission.

File

modules/audit_log_elastic_search/audit_log_elastic_search.admin.inc, line 196
Hook implemenations for the Audit elastic search logging module.

Code

function audit_log_elastic_search_create_type(Elasticsearch\Client $client, $index, $type) {
  $mapping_params['index'] = $index;
  $mapping_params['type'] = $type;
  $mapping = audit_log_elastic_search_get_mapping();
  $mapping_params['body'][$type] = $mapping;
  $client
    ->indices()
    ->putMapping($mapping_params);
}