mirror of
https://github.com/moodle/moodle.git
synced 2025-08-10 03:16: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
|
@ -119,4 +119,14 @@ class search_engine_testcase extends advanced_testcase {
|
|||
$updates = $engine->get_and_clear_schema_updates();
|
||||
$this->assertCount(0, $updates);
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests the get_supported_orders stub function.
|
||||
*/
|
||||
public function test_get_supported_orders() {
|
||||
$engine = new \mock_search\engine();
|
||||
$orders = $engine->get_supported_orders(\context_system::instance());
|
||||
$this->assertCount(1, $orders);
|
||||
$this->assertArrayHasKey('relevance', $orders);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue