You are here

function elasticsearch_watchdog_create_type in Elasticsearch Connector 7.5

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

Create Elasticsearch watchdog type.

1 call to elasticsearch_watchdog_create_type()
elasticsearch_watchdog_settings_validate in modules/elasticsearch_watchdog/elasticsearch_watchdog.admin.inc
Validate the setting form submission.

File

modules/elasticsearch_watchdog/elasticsearch_watchdog.module, line 277
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);
}