function apachesolr_autocomplete_fix_indexes in Apache Solr Autocomplete 7.2
Convert the keys in an array from '*foo' to 'foo'
Parameters
$results: An array to convert.
Return value
array The converted array.
1 call to apachesolr_autocomplete_fix_indexes()
- apachesolr_autocomplete_invoke in ./
apachesolr_autocomplete.module - Given a set of keys, invoke all the available autocomplete engines and build an array of suggestions.
File
- ./
apachesolr_autocomplete.module, line 244 - Alters search forms to suggest terms using Apache Solr using AJAX.
Code
function apachesolr_autocomplete_fix_indexes($results) {
$new = array();
foreach ($results as $key => $value) {
$new_key = substr($key, 1);
$new[$new_key] = $value;
$new[$new_key]['id'] = $new_key;
}
return $new;
}