Permalink
Browse files

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.
  • Loading branch information...
1 parent 29f8c09 commit 0713cc584d5baa223e46edfdfe7df6516e2e5a54 @stronk7 stronk7 committed Mar 16, 2013
Showing with 8 additions and 3 deletions.
  1. +8 −3 mod/glossary/sql.php
View
@@ -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);

0 comments on commit 0713cc5

Please sign in to comment.