Search · Index

PostgreSQL's Tsearch2

Install Full Text Search using Tsearch2

By Dave Bauer, Joel Aufrecht, and Malte Sussdorff, with help from Tsearch V2 Introduction by Andrew J. Kopciuch

Install Tsearch2 module

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.

  1. 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.

                [postgres pgsql]$ 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.

  2. Install Tsearch2. These instructions assume you are using the latest point release of PostgreSQL 7.4.5.

    [root root]# su - postgres
    [postgres pgsql]$ cd /usr/local/src/postgresql-7.4.5/contrib/tsearch2/
    [postgres tsearch2]$ make
    [postgres tsearch2]$ make install
    mkdir /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]$ exit
    logout
    
    [root root]#
    su - postgres
    cd /usr/local/src/postgresql-7.4.5/contrib/tsearch2
    make
    make install
    exit
previous November 2017
Sun Mon Tue Wed Thu Fri Sat
29 30 31 1 2 3 4
5 6 7 (1) 8 9 (1) 10 11
12 13 14 15 16 17 18
(2) 19 20 21 (1) 22 23 24 25
26 27 28 29 30 1 2

Popular tags

17 , 5.9.0 , 5.9.1 , ad_form , ADP , ajax , aolserver , asynchronous , bgdelivery , bootstrap , bugtracker , CentOS , COMET , CSP , CSRF , cvs , debian , emacs , engineering-standards , fedora , FreeBSD , guidelines , host-node-map , hstore , includelets , install , installation , installers , install-ns , javascript
No registered users in community xowiki
in last 30 minutes
Contributors

OpenACS.org