function apachesolr_autocomplete_form_apachesolr_settings_alter in Apache Solr Autocomplete 6
Same name and namespace in other branches
- 7.2 apachesolr_autocomplete.module \apachesolr_autocomplete_form_apachesolr_settings_alter()
- 7 apachesolr_autocomplete.module \apachesolr_autocomplete_form_apachesolr_settings_alter()
Alter the apachesolr.module "advanced settings" form.
File
- ./
apachesolr_autocomplete.module, line 494 - Alters search forms to suggest terms using Apache Solr using AJAX. Thanks to robertDouglass who contributed some of the code.
Code
function apachesolr_autocomplete_form_apachesolr_settings_alter(&$form, $form_state) {
$form['advanced']['apachesolr_autocomplete_widget'] = array(
'#type' => 'radios',
'#title' => t('Autocomplete widget to use'),
'#description' => t('The custom widget provides instant search upon selection, whereas the Drupal widget needs the user to hit Enter or click on the Search button. If you are having problems, try switching to the default Drupal autocomplete widget.'),
'#options' => array(
'custom' => t('Custom autocomplete widget'),
'drupal' => t('Drupal core autocomplete widget'),
),
'#default_value' => apachesolr_autocomplete_variable_get_widget(),
);
$form['advanced']['apachesolr_autocomplete_suggest_keywords'] = array(
'#type' => 'checkbox',
'#title' => t('Enable additional keyword suggestions on the autocomplete widget'),
'#description' => t('Suggest words to add to the currently typed-in words. E.g.: typing "blue" might suggest "blue bike" or "blue shirt".'),
'#default_value' => apachesolr_autocomplete_variable_get_suggest_keywords(),
);
$form['advanced']['apachesolr_autocomplete_suggest_spellcheck'] = array(
'#type' => 'checkbox',
'#title' => t('Enable spellchecker suggestions on the autocomplete widget'),
'#description' => t('Suggest corrections to the currently typed-in words. E.g.: typing "rec" or "redd" might suggest "red".'),
'#default_value' => apachesolr_autocomplete_variable_get_suggest_spellcheck(),
);
$form['advanced']['apachesolr_autocomplete_counts'] = array(
'#type' => 'checkbox',
'#title' => t('Enable counts in autocomplete widget suggestions'),
'#description' => t('WARNING: Counts shown alongside suggestions might be lower than the actual result count due to stemming and minimum match (mm) settings in solrconfig.xml.'),
'#default_value' => apachesolr_autocomplete_variable_get_counts(),
);
}