You are here

function apachesolr_stats_schema in Apache Solr Statistics 6

Same name and namespace in other branches
  1. 6.3 apachesolr_stats.install \apachesolr_stats_schema()
  2. 7 apachesolr_stats.install \apachesolr_stats_schema()

Implementation of hook_schema().

File

./apachesolr_stats.install, line 36

Code

function apachesolr_stats_schema() {
  $schema['apachesolr_stats'] = array(
    'description' => t('Table that contains a log of Apache Solr queries and performace.'),
    'fields' => array(
      'qid' => array(
        'type' => 'serial',
        'not null' => TRUE,
        'description' => 'Primary Key: Unique log ID.',
      ),
      'timestamp' => array(
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
        'description' => 'Unix timestamp of when query occurred.',
      ),
      'numfound' => array(
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
        'description' => 'Number of results.',
      ),
      'total_time' => array(
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
        'description' => 'Total query time (miliseconds).',
      ),
      'prepare_time' => array(
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
        'description' => 'Time taken by Solr prepare phase for this query (miliseconds).',
      ),
      'process_time' => array(
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
        'description' => 'Time taken by Solr process phase for this query (miliseconds).',
      ),
      'uid' => array(
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
        'description' => 'The {users}.uid of the user who triggered the query.',
      ),
      'sid' => array(
        'type' => 'varchar',
        'length' => 64,
        'not null' => TRUE,
        'default' => '',
        'description' => 'Session ID of user who triggered the query.',
      ),
      'showed_suggestions' => array(
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
        'description' => 'Indicates whether a spelling suggestion was shown.',
      ),
      'page' => array(
        'type' => 'varchar',
        'length' => 10,
        'not null' => TRUE,
        'default' => '',
        'description' => 'Current results page.',
      ),
      'keywords' => array(
        'type' => 'varchar',
        'length' => 128,
        'not null' => TRUE,
        'default' => '',
        'description' => 'Query keywords arguments.',
      ),
      'filters' => array(
        'type' => 'varchar',
        'length' => 128,
        'not null' => TRUE,
        'default' => '',
        'description' => 'Query filter arguments.',
      ),
      'sort' => array(
        'type' => 'varchar',
        'length' => 128,
        'not null' => TRUE,
        'default' => '',
        'description' => 'Query sort arguments.',
      ),
      'params' => array(
        'type' => 'text',
        'not null' => TRUE,
        'size' => 'big',
        'description' => "Query object's complete parameters.",
      ),
    ),
    'primary key' => array(
      'qid',
    ),
  );
  return $schema;
}