當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Helpers::search_link方法代碼示例

本文整理匯總了PHP中Helpers::search_link方法的典型用法代碼示例。如果您正苦於以下問題:PHP Helpers::search_link方法的具體用法?PHP Helpers::search_link怎麽用?PHP Helpers::search_link使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Helpers的用法示例。


在下文中一共展示了Helpers::search_link方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: test_search_by_id_returns_single_record

 function test_search_by_id_returns_single_record()
 {
     # Check that searching for an ID only gives you one result
     $test_items = array('TKI80868', 'TKI80039', 'TKI80875');
     foreach ($test_items as $value) {
         $solr = new Solr();
         $this->assertEqual(1, $solr->count($value), Helpers::search_link($value) . " should return only 1 result");
     }
 }
開發者ID:robomc,項目名稱:solr-tests,代碼行數:9,代碼來源:can_search_for_records_by_ids.php

示例2: test_staging_urls_return_no_matches

 function test_staging_urls_return_no_matches()
 {
     # Test paths for common staging urls
     $test_items = array('staging.internal', 'dev.internal', 'preprod');
     foreach ($test_items as $value) {
         $solr = new Solr();
         $this->assertEqual(0, $solr->count($value), "Search for " . Helpers::search_link($value) . " returns " . $solr->count() . " results, when none should be returned");
     }
 }
開發者ID:robomc,項目名稱:solr-tests,代碼行數:9,代碼來源:no_matches_for_non_public_content.php

示例3: test_community_names_return_homepage_as_first_result

 function test_community_names_return_homepage_as_first_result()
 {
     # Check that first result for each query is appropriate
     # homepage id
     $test_items = array('english online' => 'TKI80868', 'assessment online' => 'TKI58274', 'assessment' => 'TKI58274', 'education for enterprise' => 'TKI45249', 'digistore' => 'TKI59990', 'alternative education' => 'TKI17383', 'digital technology guidelines' => 'TKI50586', 'dtg' => 'TKI50586', 'e-asttle' => 'TKI38879', 'education for sustainability' => 'TKI50157', 'literacy online' => 'TKI58077', 'education outside the classroom' => 'TKI58260', 'esol online' => 'TKI13739', 'gifted and talented' => 'TKI17424', 'gifted and talented online' => 'TKI17424', 'he kohinga rauemi a-ipurangi' => 'TKI50637', 'new zealand curriculum' => 'TKI46672', 'tax citizenship' => 'TKI80668', 'arts online' => 'TKI31449', 'arts' => 'TKI31449', 'educational leaders' => 'TKI57127', 'home-school partnerships' => 'TKI59527', 'home school partnerships' => 'TKI59527', 'te tere auraki' => 'TKI28409', 'success for boys' => 'TKI50135', 'software for learning' => 'TKI50191');
     foreach ($test_items as $key => $value) {
         $solr = new Solr();
         $this->assertEqual($value, $solr->first($key), "{$value} wasn't first result for query " . Helpers::search_link($key));
     }
 }
開發者ID:robomc,項目名稱:solr-tests,代碼行數:10,代碼來源:first_result_for_community_name_not_community_homepage.php

示例4: test_phrases_in_index_return_matches

 function test_phrases_in_index_return_matches()
 {
     # Checks first that searching for the phrase inside quotes does match
     # If it does, checks for matches without quotes.
     $test_items = array('"animals in circuses"', '"This Chinese official"', '"This Taihape Area School"', '"refers to Waitangi as"', '"posted on any forum"', '"highest level of their interest and ability"');
     foreach ($test_items as $value) {
         $solr = new Solr();
         if ($solr->count($value) >= 1) {
             $value = trim($value, '"');
             $solr = new Solr();
             $this->assertNotEqual(0, $solr->count($value), Helpers::search_link($value) . " has " . $solr->count() . " results");
         }
     }
 }
開發者ID:robomc,項目名稱:solr-tests,代碼行數:14,代碼來源:phrases_with_stopwords_only_match_inside_quotes.php

示例5: assessSimilarity

 function assessSimilarity($array, $strict = 1, $drift = 2)
 {
     foreach ($array as $key => $value) {
         $solr = new Solr();
         $results = $solr->search($key, count($value) * $drift);
         $matches = 0;
         foreach ($results as $pid) {
             if (in_array($pid, $value)) {
                 $matches++;
             }
         }
         $this->assertTrue($matches * $strict >= count($value), "Search for " . Helpers::search_link($key) . " returned " . $matches . " of it's expected results in the top " . count($value) * $drift);
     }
 }
開發者ID:robomc,項目名稱:solr-tests,代碼行數:14,代碼來源:similarity_test_case.php

示例6: test_legacy_paths_not_indexed_with_nonlegacy_domains

 function test_legacy_paths_not_indexed_with_nonlegacy_domains()
 {
     # Searches for legacy urls on non-legacy domains, like:
     # gifted.tki.org.nz/m/search/
     $test_domains = array('gifted.tki.org.nz', 'www.wicked.org.nz', 'assessment.tki.org.nz', 'nzcurriculum.tki.org.nz', 'secondary.tki.org.nz', 'englishonline.tki.org.nz', 'artsonline.tki.org.nz');
     $test_paths = array('/e/community/ncea/', '/e/community/maorieducation/', '/e/community/pasifika/', '/m/search/', '/e/search/', '/r/literacy_numeracy/professional/teachers_notes/ready_to_read/');
     foreach ($test_domains as $domain) {
         foreach ($test_paths as $path) {
             $solr = new Solr();
             $query = $domain . $path;
             $this->assertEqual(0, $solr->count($query), Helpers::search_link($query) . " should return no results");
         }
     }
 }
開發者ID:robomc,項目名稱:solr-tests,代碼行數:14,代碼來源:index_doesnt_contain_items_with_wrong_domains.php

示例7: test_nzmaths_where_appropriate

 function test_nzmaths_where_appropriate()
 {
     # Checks that first 10 results for nzmaths related keywords
     # return good proportion of MZMaths items. Ensures fix for
     # previous function doesn't work too well.
     $test_items = array('ALiM school stories nzmaths', 'Algebra information', 'Attribute Blocks: Exploring Shape', 'scuba');
     foreach ($test_items as $value) {
         $solr = new Solr();
         $pids = $solr->search($value, 50);
         $i = 0;
         foreach ($pids as $id) {
             if (preg_match('/nzmaths/', $id)) {
                 $i++;
             }
         }
         $this->assertTrue($i > 0, "Search for " . Helpers::search_link($value) . " has insufficient nzmaths items");
     }
 }
開發者ID:robomc,項目名稱:solr-tests,代碼行數:18,代碼來源:nzmaths_getting_unwarranted_rank.php


注:本文中的Helpers::search_link方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。