function _similar_save_index in Similar Entries 7.2
Saves an index.
Parameters
string $field: The machine-name of the field being indexed.
string $table: The table to which the indexed field belongs.
string $column: The indexed table column.
array $info: Information to save about the indexed field.
- table: The table name.
- field: The field name.
- index: The index name.
- label: The human-readable field label.
Return value
bool A boolean value indicating whether the index was saved.
1 call to _similar_save_index()
- similar_index in ./
similar.module - Adds FULLTEXT index to a single field in the database.
File
- ./
similar.module, line 131 - Module that shows a block listing similar entries. NOTE: Uses MySQL's FULLTEXT indexing for MyISAM tables.
Code
function _similar_save_index($field, $table, $column, $info) {
// Return FALSE if the index name is not set in index info.
if (!isset($info['index'])) {
return FALSE;
}
$info += array(
'table' => $table,
'column' => $column,
);
$indices = variable_get(SIMILAR_INDICES);
$indices[$field] = $info;
variable_set(SIMILAR_INDICES, $indices);
return TRUE;
}