You are here

function elasticsearch_watchdog_create_type in Elasticsearch Connector 7.2

Same name and namespace in other branches
  1. 7.5 modules/elasticsearch_watchdog/elasticsearch_watchdog.module \elasticsearch_watchdog_create_type()
  2. 7 modules/elasticsearch_watchdog/elasticsearch_watchdog.admin.inc \elasticsearch_watchdog_create_type()

Create Elasticsearch watchdog type.

2 calls to elasticsearch_watchdog_create_type()
elasticsearch_watchdog_clear_log_submit in modules/elasticsearch_watchdog/elasticsearch_watchdog.admin.inc
Form submission handler for elasticsearch_watchdog_clear_log_form().
elasticsearch_watchdog_settings_validate in modules/elasticsearch_watchdog/elasticsearch_watchdog.admin.inc
Validate the setting form submission.

File

modules/elasticsearch_watchdog/elasticsearch_watchdog.admin.inc, line 864
Created on Jan 06, 2014

Code

function elasticsearch_watchdog_create_type(\nodespark\DESConnector\ClientInterface $client, $index, $type) {
  $mapping_params['index'] = $index;
  $mapping_params['type'] = $type;
  $my_type_mapping = elasticsearch_watchdog_get_mapping();
  $mapping_params['body'][$type] = $my_type_mapping;
  $client
    ->indices()
    ->putMapping($mapping_params);
}