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


PHP CSearch::searchQueryString方法代碼示例

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


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

示例1: mbLog

        mbLog($e->getMessage());
    }
}
// Recherche fulltext
$time = 0;
$nbresult = 0;
$array_results = array();
$array_highlights = array();
$array_aggregation = array();
$objects_refs = array();
$authors = array();
$author_ids = array();
$patients = array();
try {
    $date = $client_index->constructWordsWithDate($_date, $_min_date, $_max_date);
    $results_query = $client_index->searchQueryString($words, $start, 30, $names_types, $aggregate, $sejour_id, $specific_user, null, $date, $fuzzy_search);
    $results = $results_query->getResults();
    $time = $results_query->getTotalTime();
    $nbresult = $results_query->getTotalHits();
    // traitement des résultats
    $patient_ids = array();
    foreach ($results as $result) {
        $var = $result->getHit();
        $author_ids[] = $var["_source"]["author_id"];
        $patient_ids[] = $var["_source"]["patient_id"];
        $var["_source"]["body"] = CMbString::normalizeUtf8($var["_source"]["body"]);
        $array_results[] = $var;
        // Traitement des highlights
        $highlights = $result->getHighlights();
        if (count($highlights) != 0) {
            $array_highlights[] = mb_convert_encoding(implode(" [...] ", $highlights['body']), "WINDOWS-1252", "UTF-8");
開發者ID:fbone,項目名稱:mediboard4,代碼行數:31,代碼來源:ajax_result_search.php

示例2: CSearch

$type = CValue::get("type");
$fuzzy_search = CValue::get("fuzzy_search", null);
$words = html_entity_decode(CValue::get("words"));
$client_index = new CSearch();
$client_index->createClient();
$details = " object_ref_class:" . $object_ref_class . " " . "object_ref_id:" . $object_ref_id;
// Recherche fulltext
$time = 0;
$nbresult = 0;
$array_results = array();
$array_highlights = array();
$authors = array();
$author_ids = array();
$patients = array();
try {
    $results_query = $client_index->searchQueryString($words, 0, 30, array($type), false, null, null, $details, null, $fuzzy_search);
    $results = $results_query->getResults();
    $time = $results_query->getTotalTime();
    $nbresult = $results_query->getTotalHits();
    // traitement des résultats
    $patient_ids = array();
    foreach ($results as $result) {
        $var = $result->getHit();
        $author_ids[] = $var["_source"]["author_id"];
        $patient_ids[] = $var["_source"]["patient_id"];
        $var["_source"]["body"] = CMbString::normalizeUtf8($var["_source"]["body"]);
        $array_results[] = $var;
        $highlights = $result->getHighlights();
        if (count($highlights) != 0) {
            $array_highlights[] = mb_convert_encoding(implode(" [...] ", $highlights['body']), "WINDOWS-1252", "UTF-8");
        } else {
開發者ID:fbone,項目名稱:mediboard4,代碼行數:31,代碼來源:ajax_result_search_details.php


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