本文整理匯總了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");
示例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 {