Index: apachesolr_search.module =================================================================== --- apachesolr_search.module (revision 8295) +++ apachesolr_search.module (working copy) @@ -77,6 +77,12 @@ $menu['search/apachesolr_search/%menu_tail']['title'] = 'Content'; } } + + // this is probably not the best approach + $menu['search/'. variable_get('apachesolr_search_prefix', 'apachesolr_search') .'/%menu_tail'] = + $menu['search/apachesolr_search/%menu_tail']; + unset ($menu['search/apachesolr_search/%menu_tail']); + if (variable_get('apachesolr_search_taxonomy_links', 0)) { if (isset($menu['taxonomy/term/%'])) { $menu['taxonomy/term/%']['page callback'] = 'apachesolr_search_taxonomy_term_page'; @@ -126,7 +132,10 @@ $solrsort = isset($_GET['solrsort']) ? $_GET['solrsort'] : ''; $page = isset($_GET['page']) ? $_GET['page'] : 0; try { - $results = apachesolr_search_execute($keys, $filters, $solrsort, 'search/' . arg(1), $page); + //$results = apachesolr_search_execute($keys, $filters, $solrsort, 'search/' . arg(1), $page); + $results = apachesolr_search_execute($keys, $filters, $solrsort, + 'search/' . variable_get('apachesolr_search_prefix', 'apachesolr_search'), $page); + return $results; } catch (Exception $e) { @@ -148,7 +157,8 @@ // Note: search/X can not be a default tab because it would take on the // path of its parent (search). It would prevent remembering keywords when // switching tabs. This is why we drupal_goto to it from the parent instead. - drupal_goto('search/apachesolr_search'); + //drupal_goto('search/apachesolr_search'); + drupal_goto('search/'. variable_get('apachesolr_search_prefix', 'apachesolr_search')); } $keys = trim(search_get_keys()); $filters = ''; @@ -752,7 +762,9 @@ if (variable_get('clean_url', '0')) { $keys = str_replace('+', '%2B', $keys); } - $form_state['redirect'] = 'search/apachesolr_search/'. trim($keys); + //$form_state['redirect'] = 'search/apachesolr_search/'. trim($keys); + $form_state['redirect'] = 'search/'. variable_get('apachesolr_search_prefix', 'apachesolr_search') .'/'. trim($keys); + } /** @@ -824,7 +836,9 @@ function apachesolr_search_form_search_submit($form, &$form_state) { $fv = $form_state['values']; $keys = $fv['processed_keys']; - $base = 'search/'. $fv['module'] . '/'; + //$base = 'search/'. $fv['module'] . '/'; + $base = 'search/'. variable_get('apachesolr_search_prefix', 'apachesolr_search') . '/'; + if (variable_get('clean_url', '0')) { $keys = str_replace('+', '%2B', $keys); } @@ -853,6 +867,18 @@ '#options' => array(0 => t('Disabled'), 1 => t('Enabled')), '#description' => t('Hides core node search, and makes the search block submit to Apache Solr Search'), ); + + $form['advanced']['apachesolr_search_prefix'] = array( + '#type' => 'textfield', + '#title' => t('Prefix to use when conducting searches'), + '#default_value' => variable_get('apachesolr_search_prefix', 'apachesolr_search'), + '#size' => 30, + '#maxlength' => 60, + '#required' => TRUE, + '#description' => t('Changes the url when Apache Solr replaces default search ie: search/%path/terms', + array('%path' => variable_get('apachesolr_search_prefix', 'apachesolr_search'))), + ); + $form['advanced']['apachesolr_search_default_previous'] = array( '#type' => 'value', '#value' => variable_get('apachesolr_search_make_default', 0), Index: apachesolr.taxonomy.inc =================================================================== --- apachesolr.taxonomy.inc (revision 8295) +++ apachesolr.taxonomy.inc (working copy) @@ -41,7 +41,10 @@ try { //stolen from search.module (search_data) - $data = apachesolr_search_execute($keys, $filters, $solrsort, 'search/apachesolr_search', $page); + //$data = apachesolr_search_execute($keys, $filters, $solrsort, 'search/apachesolr_search', $page); + $data = apachesolr_search_execute($keys, $filters, $solrsort, + 'search'. variable_get('apachesolr_search_prefix', 'apachesolr_search'), $page); + $results = theme('search_results', $data, $type); } catch (Exception $e){ watchdog('apachesolr', t('Error running search'));