function similar_get_indices in Similar Entries 7.2
Same name and namespace in other branches
- 6.2 similar.module \similar_get_indices()
 - 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 field module install/uninstall or a cache clearance.
Parameters
string|null $field: An optional string identifying a specific field's index info to return.
Return value
array|false 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. Returns FALSE if the requested field index does not exist.
4 calls to similar_get_indices()
- similar_handler_argument_nid::options_form in views/
similar_handler_argument_nid.inc  - Defines the options form.
 - similar_handler_argument_nid::option_definition in views/
similar_handler_argument_nid.inc  - Defines default values for argument settings.
 - similar_handler_argument_nid::similar_build_query in views/
similar_handler_argument_nid.inc  - Builds a query from argument configuration options.
 - similar_reset_indices in ./
similar.module  - Clears all Similar Entries indices.
 
File
- ./
similar.module, line 160  - Module that shows a block listing similar entries. NOTE: Uses MySQL's FULLTEXT indexing for MyISAM tables.
 
Code
function similar_get_indices($field = NULL) {
  $indices =& drupal_static(__FUNCTION__);
  if (!isset($indices)) {
    $indices = variable_get(SIMILAR_INDICES, array());
  }
  return $field === NULL ? $indices : (isset($indices[$field]) ? $indices[$field] : FALSE);
}