--- modules/project/solr/project_solr.module 2009-05-04 17:59:15.186451237 -0500 +++ modules/project_patched/solr/project_solr.module 2009-05-04 17:59:23.957287596 -0500 @@ -178,25 +178,15 @@ function project_solr_browse_summary_pag return theme('item_list', $items); } -function project_solr_browse_page($term_name) { +/** + * The actual searching is done here. + */ +function project_solr_browse_search($parent_term = '') { try { - $output = ''; $vid = _project_get_vid(); - $parent_term = db_fetch_object(db_query("SELECT t.tid, t.name, t.description FROM {term_data} t WHERE LOWER(t.name) = LOWER('%s')", $term_name)); - - if (!$parent_term) { - // XXX: this is the Drupal 5 way... - return drupal_not_found(); - } - drupal_set_title(check_plain($parent_term->name)); - if (!empty($parent_term->description)) { - $output .= theme('project_type_description', $parent_term); - } - $text_query = isset($_GET['text']) ? $_GET['text'] : ''; $filters = isset($_GET['filters']) ? $_GET['filters'] : ''; - $sort = isset($_GET['solrsort']) ? check_plain($_GET['solrsort']) : ''; // Validate sort parameter @@ -236,52 +226,78 @@ function project_solr_browse_page($term_ // This hook allows modules to modify the query and params objects. apachesolr_modify_query($query, $params, 'apachesolr_search'); if (!$query) { - return array(); + return NULL; } // We add 'fq' (filter query) parameters here to include all the constant // filters for the query -- project nodes of the given top-level type that // have releases (if project_release is enabled). $fq[] = 'type:project_project'; - $fq[] = 'im_vid_'. _project_get_vid() .':'. $parent_term->tid; + if ($parent_term != '') { + $fq[] = 'im_vid_'. _project_get_vid() .':'. $parent_term->tid; + } if (module_exists('project_release')) { $fq[] = 'is_project_has_releases:1'; } $params['fq'][] = '('. implode(' AND ', $fq) .')'; - $response = $solr->search($query->get_query_basic(), $params['start'], $params['rows'], $params); // The response is cached so that it is accessible to the blocks and anything // else that needs it beyond the initial search. - $total = $response->response->numFound; - - project_solr_response_cache(array($query, $response, $parent_term)); - - // Set breadcrumb - $breadcrumb = menu_get_active_breadcrumb(); - drupal_set_breadcrumb($breadcrumb); - - $output .= '