Index: contrib/apachesolr_taxonomy/apachesolr_taxonomy.info =================================================================== RCS file: contrib/apachesolr_taxonomy/apachesolr_taxonomy.info diff -N contrib/apachesolr_taxonomy/apachesolr_taxonomy.info --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ contrib/apachesolr_taxonomy/apachesolr_taxonomy.info 17 Jun 2009 11:59:00 -0000 @@ -0,0 +1,7 @@ +; $Id$ +name = Apache Solr taxonomy integration +description = Replaces taxonomy browse pages (taxonomy/term/XXX) with Apache Solr search result pages for vocabularies enabled as filters. +dependencies[] = taxonomy +dependencies[] = apachesolr +package = Apache Solr +core = "6.x" Index: contrib/apachesolr_taxonomy/apachesolr_taxonomy.module =================================================================== RCS file: contrib/apachesolr_taxonomy/apachesolr_taxonomy.module diff -N contrib/apachesolr_taxonomy/apachesolr_taxonomy.module --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ contrib/apachesolr_taxonomy/apachesolr_taxonomy.module 17 Jun 2009 11:59:00 -0000 @@ -0,0 +1,52 @@ + 1 && $terms['operator'] != 'and') || $op != 'page' || $depth != 0) { + $redirect_to_apachesolr = FALSE; + } else { + // Check if term blongs to vocabulary selected by admin as an available filter + $term = taxonomy_get_term($terms['tids'][0]); + $vocabulary_facet_name = 'im_vid_' . $term->vid; + + if (!in_array($vocabulary_facet_name, $vids_to_override)) { + $redirect_to_apachesolr = FALSE; + } + } + + if ($redirect_to_apachesolr) { + // Return an apachesolr search page + $_GET['q'] = 'search/apachesolr_search'; + $_REQUEST['filters'] = $_GET['filters'] = 'tid:' . implode(' tid:', $terms['tids']); + $_GET['retain-filters'] = 1; + drupal_set_title(t('Results within @term', array('@term' => $term->name))); + return apachesolr_search_view("apachesolr_search"); + } else{ + // Fallback to normal taxonomy/term page + require_once("modules/taxonomy/taxonomy.pages.inc"); + return taxonomy_term_page($str_tids, $depth, $op); + } +}