MDL-25655 glossary: non full searches now working.
In the process of updting the module from 1.9 to 2.0 the (non) full search feature was lost without notice. This restitutes it with the same behavior present in 1.9: - fullsearch disabled: look into concepts and aliases. - fullsearch enabled (default): look also into definitions.
This commit is contained in:
@@ -154,7 +154,13 @@
|
||||
//$params = array();
|
||||
$i = 0;
|
||||
|
||||
$concat = $DB->sql_concat('ge.concept', "' '", 'ge.definition',"' '", "COALESCE(al.alias, '')");
|
||||
if (empty($fullsearch)) {
|
||||
// With fullsearch disabled, look only within concepts and aliases.
|
||||
$concat = $DB->sql_concat('ge.concept', "' '", "COALESCE(al.alias, '')");
|
||||
} else {
|
||||
// With fullsearch enabled, look also within definitions.
|
||||
$concat = $DB->sql_concat('ge.concept', "' '", 'ge.definition', "' '", "COALESCE(al.alias, '')");
|
||||
}
|
||||
|
||||
$searchterms = explode(" ",$hook);
|
||||
|
||||
@@ -272,5 +278,4 @@
|
||||
}
|
||||
|
||||
$query = "$sqlwrapheader $sqlselect $sqlfrom $sqlwhere $sqlwrapfooter $sqlorderby";
|
||||
$allentries = $DB->get_records_sql($query, $params, $limitfrom, $limitnum);
|
||||
|
||||
$allentries = $DB->get_records_sql($query, $params, $limitfrom, $limitnum);
|
||||
Reference in New Issue
Block a user