mirror of
https://github.com/moodle/moodle.git
synced 2025-08-08 18:36:42 +02:00
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:
parent
b63a3b04b1
commit
fc440796e9
9 changed files with 211 additions and 0 deletions
|
@ -55,6 +55,15 @@ class search extends \moodleform {
|
|||
$mform->setDefault('searchwithin', '');
|
||||
}
|
||||
|
||||
// If the search engine provides multiple ways to order results, show options.
|
||||
if (!empty($this->_customdata['orderoptions']) &&
|
||||
count($this->_customdata['orderoptions']) > 1) {
|
||||
|
||||
$mform->addElement('select', 'order', get_string('order', 'search'),
|
||||
$this->_customdata['orderoptions']);
|
||||
$mform->setDefault('order', 'relevance');
|
||||
}
|
||||
|
||||
$mform->addElement('header', 'filtersection', get_string('filterheader', 'search'));
|
||||
$mform->setExpanded('filtersection', false);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue