Index: openacs-4/packages/forums/lib/search/search-chunk-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/forums/lib/search/search-chunk-oracle.xql,v diff -u -r1.2 -r1.2.14.1 --- openacs-4/packages/forums/lib/search/search-chunk-oracle.xql 20 Apr 2004 21:13:41 -0000 1.2 +++ openacs-4/packages/forums/lib/search/search-chunk-oracle.xql 13 May 2016 18:21:57 -0000 1.2.14.1 @@ -15,7 +15,7 @@ and forums_forums.package_id = :package_id and forums_messages.state = 'approved' and upper(forums_messages.subject || ' ' || dbms_lob.substr(forums_messages.content,2500) || ' ' || person.name(forums_messages.user_id)) - like '%' || upper(:search_text) || '%' + like upper(:search_pattern) order by forums_messages.posting_date desc @@ -33,7 +33,7 @@ and forums_messages.forum_id = forums_forums.forum_id and forums_messages.state = 'approved' and upper(forums_messages.subject || ' ' || dbms_lob.substr(forums_messages.content,3500) || ' ' || person.name(forums_messages.user_id)) - like '%' || upper(:search_text) || '%' + like upper(:search_pattern) order by forums_messages.posting_date desc @@ -49,7 +49,7 @@ where forums_messages.forum_id = forums_forums.forum_id and forums_forums.package_id = :package_id and forums_messages.state = 'approved' - and contains(forums_messages.content, '%' || :search_text || '%', 1) > 0 + and contains(forums_messages.content, :search_pattern , 1) > 0 order by the_score desc, forums_messages.posting_date desc @@ -67,7 +67,7 @@ and forums_forums.package_id = :package_id and forums_messages.forum_id = forums_forums.forum_id and forums_messages.state = 'approved' - and contains(forums_messages.content, '%' || :search_text || '%', 1) > 0 + and contains(forums_messages.content, :search_pattern, 1) > 0 order by the_score desc, forums_messages.posting_date desc Index: openacs-4/packages/forums/lib/search/search-chunk-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/forums/lib/search/search-chunk-postgresql.xql,v diff -u -r1.1 -r1.1.18.1 --- openacs-4/packages/forums/lib/search/search-chunk-postgresql.xql 17 Dec 2003 15:45:30 -0000 1.1 +++ openacs-4/packages/forums/lib/search/search-chunk-postgresql.xql 13 May 2016 18:21:57 -0000 1.1.18.1 @@ -14,8 +14,8 @@ where forums_messages.forum_id = forums_forums.forum_id and forums_forums.package_id = :package_id and forums_messages.state = 'approved' - and upper(forums_messages.subject || ' ' || forums_messages.content || ' ' || person__name(forums_messages.user_id)) - like '%' || upper(:search_text) || '%' + and forums_messages.subject || ' ' || forums_messages.content || ' ' || person__name(forums_messages.user_id) + ilike :search_pattern order by forums_messages.posting_date desc @@ -32,8 +32,8 @@ and forums_forums.package_id = :package_id and forums_messages.forum_id = forums_forums.forum_id and forums_messages.state = 'approved' - and upper(forums_messages.subject || ' ' || forums_messages.content || ' ' || person__name(forums_messages.user_id)) - like '%' || upper(:search_text) || '%' + and forums_messages.subject || ' ' || forums_messages.content || ' ' || person__name(forums_messages.user_id) + ilike :search_pattern order by forums_messages.posting_date desc Index: openacs-4/packages/forums/lib/search/search-chunk.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/forums/lib/search/search-chunk.tcl,v diff -u -r1.9.2.1 -r1.9.2.2 --- openacs-4/packages/forums/lib/search/search-chunk.tcl 12 Sep 2015 11:06:25 -0000 1.9.2.1 +++ openacs-4/packages/forums/lib/search/search-chunk.tcl 13 May 2016 18:21:57 -0000 1.9.2.2 @@ -35,7 +35,8 @@ if { [parameter::get -parameter UseIntermediaForSearchP -default 0] } { append query "_intermedia" } - + + set search_pattern "%${search_text}%" db_multirow -extend { author posting_date_pretty} messages $query {} { set posting_date_pretty [lc_time_fmt $posting_date_ansi "%x %X"] if { $useScreenNameP } {