From 7a3bc40cb56edebb1339e5fbbe54f51397731786 Mon Sep 17 00:00:00 2001 From: Eric Merrill Date: Tue, 29 Mar 2016 08:52:25 -0400 Subject: [PATCH 1/2] MDL-53515 search: Add template example --- search/templates/result.mustache | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/search/templates/result.mustache b/search/templates/result.mustache index fd11ab51ab2..f28c00a47fc 100644 --- a/search/templates/result.mustache +++ b/search/templates/result.mustache @@ -52,6 +52,12 @@ "contexturl": "https://example.com/mod/example/view.php?id=2" "userurl": "https://example.com/user/profile.php?id=3", "userfullname": "Example User Full Name", + "multiplefiles": true, + "filenames": + { + "file1.txt", + "file2.txt" + } } }}
From 8dfc6291dda0b8de25cdf3e77f39c01cac38c37d Mon Sep 17 00:00:00 2001 From: Eric Merrill Date: Tue, 29 Mar 2016 08:59:44 -0400 Subject: [PATCH 2/2] MDL-53516 search: Remove file index unit test disable flag --- search/engine/solr/tests/engine_test.php | 27 +----------------------- 1 file changed, 1 insertion(+), 26 deletions(-) diff --git a/search/engine/solr/tests/engine_test.php b/search/engine/solr/tests/engine_test.php index 8d4e799cede..b74923c2a4a 100644 --- a/search/engine/solr/tests/engine_test.php +++ b/search/engine/solr/tests/engine_test.php @@ -23,7 +23,6 @@ * - define('TEST_SEARCH_SOLR_INDEXNAME', 'unittest'); * * Optional params: - * - define('TEST_SEARCH_SOLR_DISABLE_FILE_INDEXING', 1); * - define('TEST_SEARCH_SOLR_USERNAME', ''); * - define('TEST_SEARCH_SOLR_PASSWORD', ''); * - define('TEST_SEARCH_SOLR_SSLCERT', ''); @@ -100,11 +99,7 @@ class search_solr_engine_testcase extends advanced_testcase { set_config('ssl_cainfo', TEST_SEARCH_SOLR_CAINFOCERT, 'search_solr'); } - if (defined('TEST_SEARCH_SOLR_DISABLE_FILE_INDEXING') && (TEST_SEARCH_SOLR_DISABLE_FILE_INDEXING == 1)) { - set_config('fileindexing', 0, 'search_solr'); - } else { - set_config('fileindexing', 1, 'search_solr'); - } + set_config('fileindexing', 1, 'search_solr'); // We are only test indexing small string files, so setting this as low as we can. set_config('maxindexfilekb', 1, 'search_solr'); @@ -309,11 +304,6 @@ class search_solr_engine_testcase extends advanced_testcase { } public function test_index_file() { - if (defined('TEST_SEARCH_SOLR_DISABLE_FILE_INDEXING') && (TEST_SEARCH_SOLR_DISABLE_FILE_INDEXING == 1)) { - $this->markTestSkipped('Solr file indexing not enabled.'); - return; - } - // Very simple test. $this->search->index(); $querydata = new stdClass(); @@ -323,11 +313,6 @@ class search_solr_engine_testcase extends advanced_testcase { } public function test_reindexing_files() { - if (defined('TEST_SEARCH_SOLR_DISABLE_FILE_INDEXING') && (TEST_SEARCH_SOLR_DISABLE_FILE_INDEXING == 1)) { - $this->markTestSkipped('Solr file indexing not enabled.'); - return; - } - // Get engine and area to work with. $engine = $this->search->get_engine(); $areaid = \core_search\manager::generate_areaid('core_mocksearch', 'role_capabilities'); @@ -429,11 +414,6 @@ class search_solr_engine_testcase extends advanced_testcase { } public function test_index_filtered_file() { - if (defined('TEST_SEARCH_SOLR_DISABLE_FILE_INDEXING') && (TEST_SEARCH_SOLR_DISABLE_FILE_INDEXING == 1)) { - $this->markTestSkipped('Solr file indexing not enabled.'); - return; - } - // Get engine and area to work with. $engine = $this->search->get_engine(); $areaid = \core_search\manager::generate_areaid('core_mocksearch', 'role_capabilities'); @@ -497,11 +477,6 @@ class search_solr_engine_testcase extends advanced_testcase { } public function test_delete_by_id() { - if (defined('TEST_SEARCH_SOLR_DISABLE_FILE_INDEXING') && (TEST_SEARCH_SOLR_DISABLE_FILE_INDEXING == 1)) { - $this->markTestSkipped('Solr file indexing not enabled.'); - return; - } - // First get files in the index. $this->search->index(); $engine = $this->search->get_engine();