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:
@@ -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')];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user