function similar_get_indices in Similar Entries 7
Same name and namespace in other branches
- 6.2 similar.module \similar_get_indices()
- 7.2 similar.module \similar_get_indices()
Returns data about what fields are currently indexed.
Indexed tables are fields are stored in a Drupal variable. Something to do is look into ways to reset the variable upon reasonable events like a field module install/uninstall or a cache clearance.
Parameters
$table: An optional string identifying a specific table's indices to return.
Return value
An array of sub-arrays where the key is a table name and the value is an array of fields which are currently indexed in the table.
3 calls to similar_get_indices()
- similar_cron in ./
similar.module - Implements hook_cron().
- theme_similar_content in ./
similar.module - Queries the database for similar entries and puts them in a HTML list.
- _similar_add_index in ./
similar.module - Adds FULLTEXT indexes to field value database columns.
File
- ./
similar.module, line 119 - Module that shows a block listing similar entries. NOTE: Uses MySQL's FULLTEXT indexing for MyISAM tables.
Code
function similar_get_indices($table = NULL) {
$indices = variable_get('similar_indices', array());
if (!empty($table)) {
return isset($indices[$table]) ? $indices[$table] : FALSE;
}
else {
return $indices;
}
}