Skip to content

Instantly share code, notes, and snippets.

@mrded
Created November 15, 2013 15:46
Show Gist options
  • Save mrded/7486450 to your computer and use it in GitHub Desktop.
Save mrded/7486450 to your computer and use it in GitHub Desktop.
Drupal: boost relevance for solr search. #1926090
<?php
/**
* Implements hook_search_api_solr_query_alter().
*/
function custom_api_search_api_solr_query_alter(array &$call_args, SearchApiQueryInterface &$query) {
$call_args['params']['fl'] = 'is_votes-sightsrank,' . $call_args['params']['fl'] ;
$call_args['params']['bf'] = "recip(rord(is_votes-sightsrank),1, 1000, 1000)";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment