You are here

function apachesolr_schema in Apache Solr Search 6.2

Same name and namespace in other branches
  1. 8 apachesolr.install \apachesolr_schema()
  2. 6.3 apachesolr.install \apachesolr_schema()
  3. 6 apachesolr.install \apachesolr_schema()
  4. 7 apachesolr.install \apachesolr_schema()

Implementation of hook_schema().

TODO: move all node indexing/seach code to apachesolr_search

File

./apachesolr.install, line 104
Install, update and uninstall functions for the apachesolr module.

Code

function apachesolr_schema() {
  $schema['apachesolr_search_node'] = array(
    'description' => t('Stores a record of when a node property changed to determine if it needs indexing by Solr.'),
    'fields' => array(
      'nid' => array(
        'description' => t('The primary identifier for a node.'),
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'status' => array(
        'description' => t('Boolean indicating whether the node is published (visible to non-administrators).'),
        'type' => 'int',
        'not null' => TRUE,
        'default' => 1,
      ),
      'changed' => array(
        'description' => t('The Unix timestamp when a node property was changed.'),
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
      ),
    ),
    'indexes' => array(
      'changed' => array(
        'changed',
        'status',
      ),
    ),
    'primary key' => array(
      'nid',
    ),
  );
  $table = drupal_get_schema_unprocessed('system', 'cache');
  $table['description'] = 'Cache table for apachesolr to store Luke data and indexing information.';
  $schema['cache_apachesolr'] = $table;
  return $schema;
}