webmaster@1: 'Stores items that will be searched.', webmaster@1: 'fields' => array( webmaster@1: 'sid' => array( webmaster@1: 'type' => 'int', webmaster@1: 'unsigned' => TRUE, webmaster@1: 'not null' => TRUE, webmaster@1: 'default' => 0, franck@19: 'description' => 'Search item ID, e.g. node ID for nodes.', webmaster@1: ), webmaster@1: 'type' => array( webmaster@1: 'type' => 'varchar', webmaster@1: 'length' => 16, webmaster@1: 'not null' => FALSE, franck@19: 'description' => 'Type of item, e.g. node.', webmaster@1: ), webmaster@1: 'data' => array( webmaster@1: 'type' => 'text', webmaster@1: 'not null' => TRUE, webmaster@1: 'size' => 'big', franck@19: 'description' => 'List of space-separated words from the item.', webmaster@1: ), webmaster@1: 'reindex' => array( webmaster@1: 'type' => 'int', webmaster@1: 'unsigned' => TRUE, webmaster@1: 'not null' => TRUE, webmaster@1: 'default' => 0, franck@19: 'description' => 'Set to force node reindexing.', webmaster@1: ), webmaster@1: ), webmaster@1: 'unique keys' => array('sid_type' => array('sid', 'type')), webmaster@1: ); webmaster@1: webmaster@1: $schema['search_index'] = array( franck@19: 'description' => 'Stores the search index, associating words, items and scores.', webmaster@1: 'fields' => array( webmaster@1: 'word' => array( webmaster@1: 'type' => 'varchar', webmaster@1: 'length' => 50, webmaster@1: 'not null' => TRUE, webmaster@1: 'default' => '', franck@19: 'description' => 'The {search_total}.word that is associated with the search item.', webmaster@1: ), webmaster@1: 'sid' => array( webmaster@1: 'type' => 'int', webmaster@1: 'unsigned' => TRUE, webmaster@1: 'not null' => TRUE, webmaster@1: 'default' => 0, franck@19: 'description' => 'The {search_dataset}.sid of the searchable item to which the word belongs.', webmaster@1: ), webmaster@1: 'type' => array( webmaster@1: 'type' => 'varchar', webmaster@1: 'length' => 16, webmaster@1: 'not null' => FALSE, franck@19: 'description' => 'The {search_dataset}.type of the searchable item to which the word belongs.', webmaster@1: ), webmaster@1: 'score' => array( webmaster@1: 'type' => 'float', webmaster@1: 'not null' => FALSE, franck@19: 'description' => 'The numeric score of the word, higher being more important.', webmaster@1: ), webmaster@1: ), webmaster@1: 'indexes' => array( webmaster@1: 'sid_type' => array('sid', 'type'), webmaster@1: 'word' => array('word') webmaster@1: ), webmaster@1: 'unique keys' => array('word_sid_type' => array('word', 'sid', 'type')), webmaster@1: ); webmaster@1: webmaster@1: $schema['search_total'] = array( franck@19: 'description' => 'Stores search totals for words.', webmaster@1: 'fields' => array( webmaster@1: 'word' => array( franck@19: 'description' => 'Primary Key: Unique word in the search index.', webmaster@1: 'type' => 'varchar', webmaster@1: 'length' => 50, webmaster@1: 'not null' => TRUE, webmaster@1: 'default' => '', webmaster@1: ), webmaster@1: 'count' => array( franck@19: 'description' => "The count of the word in the index using Zipf's law to equalize the probability distribution.", webmaster@1: 'type' => 'float', webmaster@1: 'not null' => FALSE, webmaster@1: ), webmaster@1: ), webmaster@1: 'primary key' => array('word'), webmaster@1: ); webmaster@1: webmaster@1: $schema['search_node_links'] = array( franck@19: 'description' => 'Stores items (like nodes) that link to other nodes, used to improve search scores for nodes that are frequently linked to.', webmaster@1: 'fields' => array( webmaster@1: 'sid' => array( webmaster@1: 'type' => 'int', webmaster@1: 'unsigned' => TRUE, webmaster@1: 'not null' => TRUE, webmaster@1: 'default' => 0, franck@19: 'description' => 'The {search_dataset}.sid of the searchable item containing the link to the node.', webmaster@1: ), webmaster@1: 'type' => array( webmaster@1: 'type' => 'varchar', webmaster@1: 'length' => 16, webmaster@1: 'not null' => TRUE, webmaster@1: 'default' => '', franck@19: 'description' => 'The {search_dataset}.type of the searchable item containing the link to the node.', webmaster@1: ), webmaster@1: 'nid' => array( webmaster@1: 'type' => 'int', webmaster@1: 'unsigned' => TRUE, webmaster@1: 'not null' => TRUE, webmaster@1: 'default' => 0, franck@19: 'description' => 'The {node}.nid that this item links to.', webmaster@1: ), webmaster@1: 'caption' => array( webmaster@1: 'type' => 'text', webmaster@1: 'size' => 'big', webmaster@1: 'not null' => FALSE, franck@19: 'description' => 'The text used to link to the {node}.nid.', webmaster@1: ), webmaster@1: ), webmaster@1: 'primary key' => array('sid', 'type', 'nid'), webmaster@1: 'indexes' => array('nid' => array('nid')), webmaster@1: ); webmaster@1: webmaster@1: return $schema; webmaster@1: } webmaster@1: