Index: openacs-4/packages/tsearch2-driver/tsearch2-driver.info
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/tsearch2-driver/tsearch2-driver.info,v
diff -u -r1.3 -r1.4
--- openacs-4/packages/tsearch2-driver/tsearch2-driver.info 10 Mar 2005 01:42:15 -0000 1.3
+++ openacs-4/packages/tsearch2-driver/tsearch2-driver.info 15 May 2007 10:37:17 -0000 1.4
@@ -7,20 +7,21 @@
f
t
-
+
Dave Bauer
Full text search support for Search via Tsearch2.
Provides an implementation for the search packages service contract for searching on postgresql.
0
-
+
+
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.18 -r1.19
--- openacs-4/packages/tsearch2-driver/tcl/tsearch2-driver-procs.tcl 13 Nov 2006 04:06:13 -0000 1.18
+++ openacs-4/packages/tsearch2-driver/tcl/tsearch2-driver-procs.tcl 15 May 2007 10:37:45 -0000 1.19
@@ -29,6 +29,10 @@
} {
set index_exists_p [db_0or1row object_exists "select 1 from txt where object_id=:object_id"]
if {!$index_exists_p} {
+ set max_size_to_index [db_string get_max_size_to_index "select min(default_value) from apm_parameters where package_key = 'tsearch2-driver' and parameter_name = 'max_size_to_index'" -default "0"]
+ if {$max_size_to_index > 0} {
+ set txt [string range $txt 0 $max_size_to_index]
+ }
db_dml index "
insert into txt (object_id,fti)
values ( :object_id,
@@ -77,6 +81,10 @@
if {!$index_exists_p} {
tsearch2::index $object_id $txt $title $keywords
} else {
+ set max_size_to_index [db_string get_max_size_to_index "select min(default_value) from apm_parameters where package_key = 'tsearch2-driver' and parameter_name = 'max_size_to_index'" -default "0"]
+ if {$max_size_to_index > 0} {
+ set txt [string range $txt 0 $max_size_to_index]
+ }
db_dml update_index "
update txt set fti =
setweight(to_tsvector('default',coalesce(:title,'')),'A')