function apachesolr_text_apachesolr_cck_fields_alter in Apache Solr Search 6.2
File
- contrib/
apachesolr_text/ apachesolr_text.module, line 3
Code
function apachesolr_text_apachesolr_cck_fields_alter(&$mappings) {
// If the content permissions module is in use, fields which are not visible
// to anonymous aren't getting indexed. Adding a default case to the text
// field definition will guarantee that they get indexed as text.
$mappings['text']['default'] = array(
'display_callback' => 'apachesolr_cck_text_field_callback',
'indexing_callback' => 'apachesolr_cck_text_indexing_callback',
'index_type' => 'text',
'facets' => TRUE,
);
// Reroute the indexing callbacks for the optionwidget fields to this
// module's version, apachesolr_text_cck_text_indexing_callback,
// because we need to index both text and string versions of the fields
// (only the text version is searchable, and only the string version is
// suitable for faceting).
$mappings['text']['optionwidgets_select']['indexing_callback'] = 'apachesolr_text_cck_text_indexing_callback';
$mappings['text']['optionwidgets_buttons']['indexing_callback'] = 'apachesolr_text_cck_text_indexing_callback';
}