By Dave Bauer, Joel Aufrecht, and Malte Sussdorff, with help from Tsearch V2 Introduction by Andrew J. Kopciuch
This is a PostgreSQL module that the OpenACS tsearch2-driver package requires.
If you want full text search (FTS), and you are running PostgreSQL version 7.3 or greater, install this module to support FTS. Do this step after you have installed both PostgreSQL and AOLserver. The tsearch2 module is included with the PostgreSQL full source distribution. It is also available with the PostgreSQL contrib package provided by most distribution ports.
For PostgreSQL 7.3, refer to the Installation docs for details, because the Tsearch2 project has revised the installation since PostgreSQL 7.3 was deprecated.
For PostgreSQL 7.4, download the http://www.sai.msu.su/~megera/postgres/gist/tsearch/V2/regprocedure_7.4.patch.gz tsearch2 patch to correctly restore from a pg_dump backup. To apply this patch, download the mentioned file and place it in your postgreSQL source tree ($PGSQL_SRC). This patch makes the backup and restore procedures very simple.
cd /tmp[postgres tmp]$
wget http://www.sai.msu.su/~megera/postgres/gist/tsearch/V2/regprocedure_7.4.patch.gz[postgres pgsql]$
cd /usr/local/src/postgresql-7.4.5/[postgres postgresql-7.4.5]
gunzip /tmp/regprocedure_7.4.patch.gz[postgres postgresql-7.4.5]
patch -b -p1 < regprocedure_7.4.patch
If you installed tsearch2 from a ports package, you can use the http://www.sai.msu.su/~megera/postgres/gist/tsearch/V2/regprocedure_update.sql regprocedure script to update the database after tsearch2 is installed into it.
If you have a working version of tsearch2 in your database, you do not need to re-install the tsearch2 module. Just apply the patch and run make. This patch only affects the tsearch2.sql file. You can run the SQL script found : [right here] This script will make the modifications found in the patch, and update the fields from the existing data. From this point on, you can dump and restore the database in a normal fashion. Without this patch, you must follow the instructions at the Tsearch2 project website for backup and restore.
Postgresql 8.0 and above include the latest stable release with the above patch(es) applied.
Install Tsearch2. These instructions assume you are using the latest point release of PostgreSQL 7.4.5.
su - postgres[postgres pgsql]$
cd /usr/local/src/postgresql-7.4.5/contrib/tsearch2/[postgres tsearch2]$
make installmkdir /usr/local/pgsql/share/contrib mkdir /usr/local/pgsql/doc/contrib (2 lines omitted) /bin/sh ../../config/install-sh -c -m 755 libtsearch.so.0.0 /usr/local/pgsql/lib/tsearch.so [postgres tsearch]$
exitlogout [root root]# su - postgres cd /usr/local/src/postgresql-7.4.5/contrib/tsearch2 make make install exit