Skip to content

Instantly share code, notes, and snippets.

@pedrorocha-net
Created March 2, 2015 11:14

Revisions

  1. pedrorocha-net created this gist Mar 2, 2015.
    12 changes: 12 additions & 0 deletions gistfile1.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,12 @@
    function HOOK_ranking() {
    $rankings = array();
    $types = node_type_get_types();
    foreach ($types as $type) {
    $rankings[$type->type . '_node_type_boost_search'] = array(
    'title' => t('Boost "' . $type->name . '" nodes'),
    'arguments' => array(':type' => $type->type),
    'score' => ' FIND_IN_SET(n.type, :type)',
    );
    }
    return $rankings;
    }