comparison modules/search/search.install @ 19:3edae6ecd6c6 6.9

Drupal 6.9
author Franck Deroche <franck@defr.org>
date Thu, 15 Jan 2009 10:15:56 +0100
parents c1f4ac30525a
children
comparison
equal deleted inserted replaced
18:f5131a9cd9e5 19:3edae6ecd6c6
1 <?php 1 <?php
2 // $Id: search.install,v 1.14 2007/12/28 10:53:27 dries Exp $ 2 // $Id: search.install,v 1.14.2.1 2009/01/06 15:46:37 goba Exp $
3 3
4 /** 4 /**
5 * Implementation of hook_install(). 5 * Implementation of hook_install().
6 */ 6 */
7 function search_install() { 7 function search_install() {
24 /** 24 /**
25 * Implementation of hook_schema(). 25 * Implementation of hook_schema().
26 */ 26 */
27 function search_schema() { 27 function search_schema() {
28 $schema['search_dataset'] = array( 28 $schema['search_dataset'] = array(
29 'description' => t('Stores items that will be searched.'), 29 'description' => 'Stores items that will be searched.',
30 'fields' => array( 30 'fields' => array(
31 'sid' => array( 31 'sid' => array(
32 'type' => 'int', 32 'type' => 'int',
33 'unsigned' => TRUE, 33 'unsigned' => TRUE,
34 'not null' => TRUE, 34 'not null' => TRUE,
35 'default' => 0, 35 'default' => 0,
36 'description' => t('Search item ID, e.g. node ID for nodes.'), 36 'description' => 'Search item ID, e.g. node ID for nodes.',
37 ), 37 ),
38 'type' => array( 38 'type' => array(
39 'type' => 'varchar', 39 'type' => 'varchar',
40 'length' => 16, 40 'length' => 16,
41 'not null' => FALSE, 41 'not null' => FALSE,
42 'description' => t('Type of item, e.g. node.'), 42 'description' => 'Type of item, e.g. node.',
43 ), 43 ),
44 'data' => array( 44 'data' => array(
45 'type' => 'text', 45 'type' => 'text',
46 'not null' => TRUE, 46 'not null' => TRUE,
47 'size' => 'big', 47 'size' => 'big',
48 'description' => t('List of space-separated words from the item.'), 48 'description' => 'List of space-separated words from the item.',
49 ), 49 ),
50 'reindex' => array( 50 'reindex' => array(
51 'type' => 'int', 51 'type' => 'int',
52 'unsigned' => TRUE, 52 'unsigned' => TRUE,
53 'not null' => TRUE, 53 'not null' => TRUE,
54 'default' => 0, 54 'default' => 0,
55 'description' => t('Set to force node reindexing.'), 55 'description' => 'Set to force node reindexing.',
56 ), 56 ),
57 ), 57 ),
58 'unique keys' => array('sid_type' => array('sid', 'type')), 58 'unique keys' => array('sid_type' => array('sid', 'type')),
59 ); 59 );
60 60
61 $schema['search_index'] = array( 61 $schema['search_index'] = array(
62 'description' => t('Stores the search index, associating words, items and scores.'), 62 'description' => 'Stores the search index, associating words, items and scores.',
63 'fields' => array( 63 'fields' => array(
64 'word' => array( 64 'word' => array(
65 'type' => 'varchar', 65 'type' => 'varchar',
66 'length' => 50, 66 'length' => 50,
67 'not null' => TRUE, 67 'not null' => TRUE,
68 'default' => '', 68 'default' => '',
69 'description' => t('The {search_total}.word that is associated with the search item.'), 69 'description' => 'The {search_total}.word that is associated with the search item.',
70 ), 70 ),
71 'sid' => array( 71 'sid' => array(
72 'type' => 'int', 72 'type' => 'int',
73 'unsigned' => TRUE, 73 'unsigned' => TRUE,
74 'not null' => TRUE, 74 'not null' => TRUE,
75 'default' => 0, 75 'default' => 0,
76 'description' => t('The {search_dataset}.sid of the searchable item to which the word belongs.'), 76 'description' => 'The {search_dataset}.sid of the searchable item to which the word belongs.',
77 ), 77 ),
78 'type' => array( 78 'type' => array(
79 'type' => 'varchar', 79 'type' => 'varchar',
80 'length' => 16, 80 'length' => 16,
81 'not null' => FALSE, 81 'not null' => FALSE,
82 'description' => t('The {search_dataset}.type of the searchable item to which the word belongs.'), 82 'description' => 'The {search_dataset}.type of the searchable item to which the word belongs.',
83 ), 83 ),
84 'score' => array( 84 'score' => array(
85 'type' => 'float', 85 'type' => 'float',
86 'not null' => FALSE, 86 'not null' => FALSE,
87 'description' => t('The numeric score of the word, higher being more important.'), 87 'description' => 'The numeric score of the word, higher being more important.',
88 ), 88 ),
89 ), 89 ),
90 'indexes' => array( 90 'indexes' => array(
91 'sid_type' => array('sid', 'type'), 91 'sid_type' => array('sid', 'type'),
92 'word' => array('word') 92 'word' => array('word')
93 ), 93 ),
94 'unique keys' => array('word_sid_type' => array('word', 'sid', 'type')), 94 'unique keys' => array('word_sid_type' => array('word', 'sid', 'type')),
95 ); 95 );
96 96
97 $schema['search_total'] = array( 97 $schema['search_total'] = array(
98 'description' => t('Stores search totals for words.'), 98 'description' => 'Stores search totals for words.',
99 'fields' => array( 99 'fields' => array(
100 'word' => array( 100 'word' => array(
101 'description' => t('Primary Key: Unique word in the search index.'), 101 'description' => 'Primary Key: Unique word in the search index.',
102 'type' => 'varchar', 102 'type' => 'varchar',
103 'length' => 50, 103 'length' => 50,
104 'not null' => TRUE, 104 'not null' => TRUE,
105 'default' => '', 105 'default' => '',
106 ), 106 ),
107 'count' => array( 107 'count' => array(
108 'description' => t("The count of the word in the index using Zipf's law to equalize the probability distribution."), 108 'description' => "The count of the word in the index using Zipf's law to equalize the probability distribution.",
109 'type' => 'float', 109 'type' => 'float',
110 'not null' => FALSE, 110 'not null' => FALSE,
111 ), 111 ),
112 ), 112 ),
113 'primary key' => array('word'), 113 'primary key' => array('word'),
114 ); 114 );
115 115
116 $schema['search_node_links'] = array( 116 $schema['search_node_links'] = array(
117 'description' => t('Stores items (like nodes) that link to other nodes, used to improve search scores for nodes that are frequently linked to.'), 117 'description' => 'Stores items (like nodes) that link to other nodes, used to improve search scores for nodes that are frequently linked to.',
118 'fields' => array( 118 'fields' => array(
119 'sid' => array( 119 'sid' => array(
120 'type' => 'int', 120 'type' => 'int',
121 'unsigned' => TRUE, 121 'unsigned' => TRUE,
122 'not null' => TRUE, 122 'not null' => TRUE,
123 'default' => 0, 123 'default' => 0,
124 'description' => t('The {search_dataset}.sid of the searchable item containing the link to the node.'), 124 'description' => 'The {search_dataset}.sid of the searchable item containing the link to the node.',
125 ), 125 ),
126 'type' => array( 126 'type' => array(
127 'type' => 'varchar', 127 'type' => 'varchar',
128 'length' => 16, 128 'length' => 16,
129 'not null' => TRUE, 129 'not null' => TRUE,
130 'default' => '', 130 'default' => '',
131 'description' => t('The {search_dataset}.type of the searchable item containing the link to the node.'), 131 'description' => 'The {search_dataset}.type of the searchable item containing the link to the node.',
132 ), 132 ),
133 'nid' => array( 133 'nid' => array(
134 'type' => 'int', 134 'type' => 'int',
135 'unsigned' => TRUE, 135 'unsigned' => TRUE,
136 'not null' => TRUE, 136 'not null' => TRUE,
137 'default' => 0, 137 'default' => 0,
138 'description' => t('The {node}.nid that this item links to.'), 138 'description' => 'The {node}.nid that this item links to.',
139 ), 139 ),
140 'caption' => array( 140 'caption' => array(
141 'type' => 'text', 141 'type' => 'text',
142 'size' => 'big', 142 'size' => 'big',
143 'not null' => FALSE, 143 'not null' => FALSE,
144 'description' => t('The text used to link to the {node}.nid.'), 144 'description' => 'The text used to link to the {node}.nid.',
145 ), 145 ),
146 ), 146 ),
147 'primary key' => array('sid', 'type', 'nid'), 147 'primary key' => array('sid', 'type', 'nid'),
148 'indexes' => array('nid' => array('nid')), 148 'indexes' => array('nid' => array('nid')),
149 ); 149 );