function _apachesolr_field_name_map in Apache Solr Search 5.2
Same name and namespace in other branches
- 6 apachesolr.admin.inc \_apachesolr_field_name_map()
Try to map a schema field name to a human-readable description.
3 calls to _apachesolr_field_name_map()
- apachesolr_field_name_map in ./
apachesolr.module - Try to map a schema field name to a human-readable description.
- apachesolr_mlt_block_form in ./
apachesolr.admin.inc - Form to edit moreLikeThis block settings.
- apachesolr_mlt_get_fields in ./
apachesolr.admin.inc - Constructs a list of field names used on the settings form.
File
- ./
apachesolr.admin.inc, line 448 - Administrative pages for the Apache Solr framework.
Code
function _apachesolr_field_name_map($field_name) {
static $map;
if (!isset($map)) {
$map = array(
'body' => t('Body text - the full, rendered content'),
'title' => t('Title'),
'teaser' => t('Teaser'),
'name' => t('Author name'),
'path_alias' => t('Path alias'),
'taxonomy_names' => t('All taxonomy term names'),
'tags_h1' => t('Body text inside H1 tags'),
'tags_h2_h3' => t('Body text inside H2 or H3 tags'),
'tags_h4_h5_h6' => t('Body text inside H4, H5, or H6 tags'),
'tags_inline' => t('Body text in inline tags like EM or STRONG'),
'tags_a' => t('Body text inside links (A tags)'),
'tid' => t('Taxonomy term IDs'),
);
if (module_exists('taxonomy')) {
foreach (taxonomy_get_vocabularies() as $vocab) {
$map['ts_vid_' . $vocab->vid . '_names'] = t('Taxonomy term names only from the %name vocabulary', array(
'%name' => $vocab->name,
));
$map['im_vid_' . $vocab->vid] = t('Taxonomy term IDs from the %name vocabulary', array(
'%name' => $vocab->name,
));
}
}
foreach (apachesolr_cck_fields() as $name => $field) {
$map[apachesolr_index_key($field)] = t('CCK @type field !label', array(
'@type' => $field['index_type'],
'!name' => $field['label'],
));
}
drupal_alter('apachesolr_field_name_map', $map);
}
return isset($map[$field_name]) ? $map[$field_name] : $field_name;
}