function apachesolr_search_get_fields in Apache Solr Search 7
Same name and namespace in other branches
- 8 apachesolr_search.admin.inc \apachesolr_search_get_fields()
- 6.3 apachesolr_search.admin.inc \apachesolr_search_get_fields()
Menu callback - the settings form.
1 call to apachesolr_search_get_fields()
- apachesolr_bias_settings_page in ./
apachesolr_search.admin.inc - Menu callback - Bias settings form.
File
- ./
apachesolr_search.admin.inc, line 644 - Administrative settings for searching.
Code
function apachesolr_search_get_fields($environment = NULL) {
if (empty($environment)) {
$env_id = apachesolr_default_environment();
$environment = apachesolr_environment_load($env_id);
}
$env_id = $environment['env_id'];
// Try to fetch the schema fields.
try {
$solr = apachesolr_get_solr($env_id);
$fields = $solr
->getFields();
return $fields;
} catch (Exception $e) {
apachesolr_log_exception($env_id, $e);
drupal_set_message(nl2br(check_plain($e
->getMessage())), 'warning');
drupal_set_message(t('Cannot get information about the fields in the index.'), 'warning');
}
}