コード例 #1
0
        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");
コード例 #2
0
$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 {