MDL-59434 core_search: Alternate result orders including by context

Implements a mechanism by which search engines can provide different
result orderings, and implements a 'by location' ordering within the
Solr search engine (available whenever the user starts their search
from within a course or activity).
This commit is contained in:
sam marshall
2018-03-20 12:15:25 +00:00
parent b63a3b04b1
commit fc440796e9
9 changed files with 211 additions and 0 deletions
+13
View File
@@ -543,4 +543,17 @@ abstract class engine {
public function supports_group_filtering() {
return false;
}
/**
* Obtain a list of results orders (and names for them) that are supported by this
* search engine in the given context.
*
* By default, engines sort by relevance only.
*
* @param \context $context Context that the user requested search from
* @return array Array from order name => display text
*/
public function get_supported_orders(\context $context) {
return ['relevance' => get_string('order_relevance', 'search')];
}
}