Tech Support Case Studies
We've received several inquiries about adding custom sorts to the the sorting block on search results for our popular Acquia Search product. This is fortunately quite easy, though it currently involves preparing a custom module that implements one hook:
hook_apachesolr_prepare_query(&$query)
<?php
function hook_apachesolr_prepare_query(&$query) {
// You can get the 'solr_field_name' from q=admin/reports/apachesolr
$query->set_available_sort('solr_field_name', array(
// how the sort link is to appear in the sorts block
'title' => t('Name of sort'),
'default' => 'asc', // or 'desc'
));
}
?>