Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagephp
titletheme_preprocess_islandora_solr
collapsetrue
function bartik_preprocess_islandora_solr(&$variables) {
	$results = &$variables['results'];
		foreach ($results as &$result) {
			if (!empty($result['solr_doc']['bundle_name'])) {
			$path = url('http://aurltothethumbnail'); //could check bundle for type and link to thumbnail for each type
			$options = array('html' => TRUE);
			$options['attributes']['title'] = $result['solr_doc']['label'];
			$image = theme('image', array('path' => $path));
			$key['thumbnail'] = l($image, $result['solr_doc']['url']['value'], $options);
		}
	}
}
Note
Modifying the results by using a theme_preprocess hook is probably the easist way to modify your results but is probably also the most brittle. For instance if you change your theme your search results page may break.

Multi-site

If you are using a Drupal multi-site setup and you have more than one Drupal site's content in Solr you will probably want to filter on the site field or the hash field to limit results to just the drupal site you are viewing. This can be done in the Islandora Solr Settings -> Query defaults config page or you can setup a custom request handler in the solrconfig.xml.

...