This code will never give what you'd expect:

    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']));
    }

Typo error, you should write this:

    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']));
    }

Sorry for not submitting a patch, this is just a word to change.

CommentFileSizeAuthor
#1 664860.patch888 bytesrobertdouglass

Comments

robertdouglass’s picture

Status: Active » Fixed
StatusFileSize
new888 bytes

#664860 by pounard: Fixed Wrong t() usage in apachesolr_field_name_map().

Good catch. Thanks.

pounard’s picture

You're welcome :)

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

cjdavis’s picture

Status: Closed (fixed) » Active

Almost there - it should be $field['name'] rather than $field['label'], so:

    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']));
    }

And some keywords in case anyone is searching like I was:
This affects the Field biases section of the Search fields tab of the Apache Solr settings, located at /admin/settings/apachesolr/query-fields. Also 'Apache Solr recommendations: More like this' block configuration, under 'Fields for finding related content' The problem is seeing only 'CCK text field' without the actual field name appended.

jpmckinney’s picture

Issue tags: +D6

Note: doesn't affect 7.x.

jpmckinney’s picture

Status: Active » Fixed

What's wrong with label? It's more human readable than name.

Status: Fixed » Closed (fixed)
Issue tags: -D6

Automatically closed -- issue fixed for 2 weeks with no activity.