function apachesolr_search_form_search_submit in Apache Solr Search 6
Same name and namespace in other branches
- 8 apachesolr_search.module \apachesolr_search_form_search_submit()
- 5.2 apachesolr_search.module \apachesolr_search_form_search_submit()
- 6.2 apachesolr_search.module \apachesolr_search_form_search_submit()
- 7 apachesolr_search.module \apachesolr_search_form_search_submit()
Added form submit function to account for Apache mode_rewrite quirks.
See also
apachesolr_search_form_search_form_alter()
1 string reference to 'apachesolr_search_form_search_submit'
- apachesolr_search_form_search_form_alter in ./
apachesolr_search.module - Implementation of hook_form_[form_id]_alter().
File
- ./
apachesolr_search.module, line 989 - Provides a content search implementation for node content for use with the Apache Solr search application.
Code
function apachesolr_search_form_search_submit($form, &$form_state) {
$fv = $form_state['values'];
$keys = $fv['processed_keys'];
$base = 'search/' . $fv['module'] . '/';
if (variable_get('clean_url', '0')) {
$keys = str_replace('+', '%2B', $keys);
}
$get = json_decode($fv['apachesolr_search']['get'], TRUE);
$queryvalues = json_decode($fv['apachesolr_search']['queryvalues'], TRUE);
if (!empty($fv['apachesolr_search']['retain-filters']) && $queryvalues) {
$get = $queryvalues + $get;
$get['retain-filters'] = '1';
}
$form_state['redirect'] = array(
$base . $keys,
$get,
);
if ($keys == '' && !$queryvalues) {
form_set_error('keys', t('Please enter some keywords.'));
}
}