You are here

function audit_log_elastic_search_get_mapping in Audit Log 7

Default index mapping for the elasticsearch watchdog index.

Parameters

int $ttl: Time To Live setting.

Return value

array The mapping index array.

1 call to audit_log_elastic_search_get_mapping()
audit_log_elastic_search_create_type in modules/audit_log_elastic_search/audit_log_elastic_search.admin.inc
Create Elasticsearch watchdog type.

File

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

Code

function audit_log_elastic_search_get_mapping($ttl = NULL) {
  if (!isset($ttl)) {
    $ttl = variable_get('audit_log_elastic_search_ttl', AUDIT_LOG_ELASTIC_SEARCH_DEFAULT_INTERVAL);
  }
  $mapping = array(
    '_source' => array(
      'enabled' => TRUE,
    ),
    '_all' => array(
      'enabled' => FALSE,
    ),
    '_ttl' => array(
      'enabled' => TRUE,
      'default' => $ttl,
    ),
    'properties' => array(
      'uid' => array(
        'type' => 'integer',
      ),
      'name' => array(
        'type' => 'string',
        'index' => 'not_analyzed',
      ),
      'url' => array(
        'type' => 'string',
        'index' => 'not_analyzed',
      ),
      'entity_id' => array(
        'type' => 'integer',
      ),
      'entity_type' => array(
        'type' => 'string',
        'index' => 'not_analyzed',
      ),
      'bundle' => array(
        'type' => 'string',
        'index' => 'not_analyzed',
      ),
      'bundle' => array(
        'type' => 'string',
        'index' => 'not_analyzed',
      ),
      'entity_label' => array(
        'type' => 'string',
        'index' => 'not_analyzed',
      ),
      'audit_action' => array(
        'type' => 'string',
        'index' => 'not_analyzed',
      ),
      'timestamp' => array(
        'type' => 'long',
      ),
      'microtime' => array(
        'type' => 'float',
      ),
      'date' => array(
        'type' => 'date',
      ),
    ),
  );
  return $mapping;
}