当前位置: 首页>>代码示例>>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;未经允许,请勿转载。