function suggestion_schema in Autocomplete Search Suggestions 8.2
Same name and namespace in other branches
- 8 suggestion.install \suggestion_schema()
- 7 suggestion.install \suggestion_schema()
- 3.0.x suggestion.install \suggestion_schema()
Implements hook_schema().
File
- ./
suggestion.install, line 13 - Contains suggestion.install.
Code
function suggestion_schema() {
$schema['suggestion'] = [
'description' => 'Suggestion data.',
'fields' => [
'ngram' => [
'description' => "The suggestion string.",
'type' => 'varchar',
'length' => 65,
'binary' => TRUE,
'not null' => TRUE,
],
'src' => [
'description' => "Suggestion source bitmap: 0 = disabled, 1 = content, 2 = surfer, 4 = priority",
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 1,
],
'atoms' => [
'description' => "The number of words in this suggestion.",
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 1,
],
'qty' => [
'description' => "The number of instances.",
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 1,
],
'density' => [
'description' => "The weighted average.",
'type' => 'float',
'unsigned' => TRUE,
'precision' => 3,
'not null' => TRUE,
'default' => 1.0,
],
'langcode' => [
'description' => "The language of suggestion string.",
'type' => 'varchar',
'length' => 32,
'binary' => TRUE,
'not null' => TRUE,
'default' => '',
],
],
'indexes' => [
'atoms' => [
'atoms',
],
'density' => [
'density',
],
'langcode' => [
'langcode',
],
'qty' => [
'qty',
],
'src' => [
'src',
],
'src_lang' => [
'src',
'langcode',
],
'density_ngram_atom' => [
'density',
'ngram',
'atoms',
],
'atom_src_lang_ngram' => [
'atoms',
'src',
'langcode',
'ngram',
],
],
'primary key' => [
'langcode',
'ngram',
],
];
return $schema;
}