You are here

function apachesolr_field_name_map in Apache Solr Search 6.2

Same name and namespace in other branches
  1. 8 apachesolr.module \apachesolr_field_name_map()
  2. 5.2 apachesolr.module \apachesolr_field_name_map()
  3. 6.3 apachesolr.module \apachesolr_field_name_map()
  4. 6 apachesolr.module \apachesolr_field_name_map()
  5. 7 apachesolr.module \apachesolr_field_name_map()

Try to map a schema field name to a human-readable description.

3 calls to apachesolr_field_name_map()
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.
apachesolr_search_settings_form in ./apachesolr_search.admin.inc
Form builder function to set query field weights.

File

./apachesolr.module, line 1849
Integration with the Apache Solr search application.

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'],
        '%label' => $field['label'],
      ));
    }
    drupal_alter('apachesolr_field_name_map', $map);
  }
  return isset($map[$field_name]) ? $map[$field_name] : $field_name;
}