You are here

function similar_get_indices in Similar Entries 6.2

Same name and namespace in other branches
  1. 7.2 similar.module \similar_get_indices()
  2. 7 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 CCK 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.

5 calls to similar_get_indices()
similar_cron in ./similar.module
Implements hook_cron().
similar_handler_argument_nid::get_field_options in views/similar_handler_argument_nid.inc
Returns an array of fields that have been indexed by Similar Entries.
similar_handler_argument_nid::similar_build_query in views/similar_handler_argument_nid.inc
Builds a query from argument configuration options.
similar_views_data in views/similar.views.inc
Implements hook_views_data().
_similar_add_index in ./similar.module
Adds FULLTEXT indexes to CCK database columns.

File

./similar.module, line 120
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;
  }
}