Index: openacs-4/packages/tsearch2-driver/tcl/tsearch2-driver-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/tsearch2-driver/tcl/tsearch2-driver-procs.tcl,v diff -u -r1.7.2.1 -r1.7.2.2 --- openacs-4/packages/tsearch2-driver/tcl/tsearch2-driver-procs.tcl 13 Dec 2004 18:40:43 -0000 1.7.2.1 +++ openacs-4/packages/tsearch2-driver/tcl/tsearch2-driver-procs.tcl 13 Dec 2004 18:42:23 -0000 1.7.2.2 @@ -188,6 +188,9 @@ @param string string to convert @return returns formatted query string for tsearch2 tsquery } { + # get rid of everything that isn't a letter or number + regsub -all {[^?\d\w]} $query {} query + # replace boolean words with boolean operators set query [string map {" and " & " or " | " not " !} $query] # remove leading and trailing spaces so they aren't turned into | @@ -199,4 +202,4 @@ # if a ! is by itself then prepend & regsub {(\w)([!])} $query {\1\&!} query return $query -} \ No newline at end of file +}