5 * Definition of views_handler_sort_search_score.
9 * Field handler to provide simple renderer that allows linking to a node.
11 * @ingroup views_sort_handlers
13 class views_handler_sort_search_score extends views_handler_sort {
15 // Check to see if the search filter/argument added 'score' to the table.
16 // Our filter stores it as $handler->search_score -- and we also
17 // need to check its relationship to make sure that we're using the same
18 // one or obviously this won't work.
19 foreach (array('filter', 'argument') as $type) {
20 foreach ($this->view->{$type} as $handler) {
21 if (isset($handler->search_score) && $handler->relationship == $this->relationship) {
22 $this->query->add_orderby(NULL, NULL, $this->options['order'], $handler->search_score);
23 $this->table_alias = $handler->table_alias;
29 // Do absolutely nothing if there is no filter/argument in place; there is no reason to
30 // sort on the raw scores with this handler.