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 2017-11-23 10:55:07 +00:00
parent b63a3b04b1
commit fc440796e9
9 changed files with 211 additions and 0 deletions

View file

@ -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);
}
}