You are here

private function SearchApiElasticsearchConnectorStats::getStatsMapping in Elasticsearch Connector 7.5

Same name and namespace in other branches
  1. 7 modules/elasticsearch_connector_search_api/includes/elasticsearch_stats.inc \SearchApiElasticsearchConnectorStats::getStatsMapping()
  2. 7.2 modules/elasticsearch_connector_search_api/includes/elasticsearch_stats.inc \SearchApiElasticsearchConnectorStats::getStatsMapping()

Return the mapping required by the statistics module.

Return value

array The mapping for the statistics document.

1 call to SearchApiElasticsearchConnectorStats::getStatsMapping()
SearchApiElasticsearchConnectorStats::createStatsIndex in modules/elasticsearch_connector_search_api/includes/elasticsearch_stats.inc
Create Elasticsearch connector search api statistics type.

File

modules/elasticsearch_connector_search_api/includes/elasticsearch_stats.inc, line 77
@author nikolayignatov

Class

SearchApiElasticsearchConnectorStats

Code

private function getStatsMapping() {

  // Index Mapping
  $my_type_mapping = array(
    '_source' => array(
      'enabled' => TRUE,
    ),
    '_all' => array(
      'enabled' => TRUE,
    ),
    'properties' => array(
      'server_name' => array(
        'type' => 'keyword',
      ),
      'index_name' => array(
        'type' => 'keyword',
      ),
      'keywords_original' => array(
        'type' => 'keyword',
      ),
      'keywords' => array(
        'type' => 'keyword',
      ),
      'filters' => array(
        'type' => 'keyword',
      ),
      'sort' => array(
        'type' => 'keyword',
      ),
      'uid' => array(
        'type' => 'long',
      ),
      'results' => array(
        'type' => 'long',
      ),
      'username' => array(
        'type' => 'keyword',
      ),
      'ip' => array(
        'type' => 'ip',
      ),
      'timestamp' => array(
        'type' => 'date',
        'format' => 'epoch_second',
      ),
    ),
  );
  return $my_type_mapping;
}