diff options
author | Gábor Hojtsy <gabor@hojtsy.hu> | 2007-10-10 11:39:35 +0000 |
---|---|---|
committer | Gábor Hojtsy <gabor@hojtsy.hu> | 2007-10-10 11:39:35 +0000 |
commit | 8cf6fefe54f47e792cfd92c917c2c41d4523da7b (patch) | |
tree | b879701f7d8768fb10864536721f54a683e5a5ee /modules/search | |
parent | e5b36135496c874a8686eda2efb1635abae41871 (diff) | |
download | brdo-8cf6fefe54f47e792cfd92c917c2c41d4523da7b.tar.gz brdo-8cf6fefe54f47e792cfd92c917c2c41d4523da7b.tar.bz2 |
#164983 by multiple contributors: document the core database schemas
Diffstat (limited to 'modules/search')
-rw-r--r-- | modules/search/search.install | 87 |
1 files changed, 74 insertions, 13 deletions
diff --git a/modules/search/search.install b/modules/search/search.install index 3f2fc48ab..93c8a2fa5 100644 --- a/modules/search/search.install +++ b/modules/search/search.install @@ -26,34 +26,95 @@ function search_uninstall() { */ function search_schema() { $schema['search_dataset'] = array( + 'description' => t('Stores items that will be searched.'), 'fields' => array( - 'sid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0), - 'type' => array('type' => 'varchar', 'length' => 16, 'not null' => FALSE), - 'data' => array('type' => 'text', 'not null' => TRUE, 'size' => 'big') + 'sid' => array( + 'type' => 'int', + 'unsigned' => TRUE, + 'not null' => TRUE, + 'default' => 0, + 'description' => t('Search item ID, e.g. node ID for nodes.'), + ), + 'type' => array( + 'type' => 'varchar', + 'length' => 16, + 'not null' => FALSE, + 'description' => t('Type of item, e.g. node.'), + ), + 'data' => array( + 'type' => 'text', + 'not null' => TRUE, + 'size' => 'big', + 'description' => t('List of space-separated words from the item.'), + ), ), 'indexes' => array('sid_type' => array('sid', 'type')), ); $schema['search_index'] = array( + 'description' => t('Stores the search index, associating words, items and scores.'), 'fields' => array( - 'word' => array('type' => 'varchar', 'length' => 50, 'not null' => TRUE, 'default' => ''), - 'sid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0), - 'type' => array('type' => 'varchar', 'length' => 16, 'not null' => FALSE), - 'fromsid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0), - 'fromtype' => array('type' => 'varchar', 'length' => 16, 'not null' => FALSE), - 'score' => array('type' => 'float', 'not null' => FALSE) + 'word' => array( + 'type' => 'varchar', + 'length' => 50, + 'not null' => TRUE, + 'default' => '', + 'description' => t('The {search_total}.word that is associated with the search item.'), + ), + 'sid' => array( + 'type' => 'int', + 'unsigned' => TRUE, + 'not null' => TRUE, + 'default' => 0, + 'description' => t('The {search_dataset}.sid of the searchable item to which the word belongs.'), + ), + 'type' => array( + 'type' => 'varchar', + 'length' => 16, + 'not null' => FALSE, + 'description' => t('The {search_dataset}.type of the searchable item to which the word belongs.'), + ), + 'fromsid' => array( + 'type' => 'int', + 'unsigned' => TRUE, + 'not null' => TRUE, + 'default' => 0, + 'description' => t('The {search_dataset}.sid of the referring link to this item.'), + ), + 'fromtype' => array( + 'type' => 'varchar', + 'length' => 16, + 'not null' => FALSE, + 'description' => t('The {search_dataset}.type of the referring link to this item.'), + ), + 'score' => array( + 'type' => 'float', + 'not null' => FALSE, + 'description' => t('The numeric score of the word, higher being more important.'), + ), ), 'indexes' => array( 'from_sid_type' => array('fromsid', 'fromtype'), - 'sid_type' => array('sid', 'type'), - 'word' => array('word') + 'sid_type' => array('sid', 'type'), + 'word' => array('word') ), ); $schema['search_total'] = array( + 'description' => t('Stores search totals for words.'), 'fields' => array( - 'word' => array('type' => 'varchar', 'length' => 50, 'not null' => TRUE, 'default' => ''), - 'count' => array('type' => 'float', 'not null' => FALSE) + 'word' => array( + 'description' => t('Primary Key: Unique word in the search index.'), + 'type' => 'varchar', + 'length' => 50, + 'not null' => TRUE, + 'default' => '', + ), + 'count' => array( + 'description' => t("The count of the word in the index using Zipf's law to equalize the probability distribution."), + 'type' => 'float', + 'not null' => FALSE, + ), ), 'primary key' => array('word'), ); |