TSEARCH2 PostgreSQL FtsEngineDriver for OpenACS 5.x

Installing

You'll need PostgreSQL 7.3 or newer. The tsearch2 from contrib needs to be compiled. In addition tsearch2.sql needs to be loaded into your database. In addition be sure to mount the Search package somewhere. The indexer will not run is Search is not mounted. The FtsEngineDriver parameter of the search package must be changes to "tsearch2-driver".

Using

If you install tsearch2-driver and mount search, go ahead and add some content. Weblogger or edit-this-page will generate indexed cotent. I had to manually load lars-blogger-sc-create.sql to get Weblogger to register the service contract implementation to index the content. After that it worked fine.

Index old content

If your old content has not been indexed before (e.g. because you had no search package mounted before), all is fine. Otherwise you have to inform the search package to reindex.
insert into search_observer_queue ( select my_id, now(),'INSERT' from my_table);
For forums and ETP this looks like:
insert into search_observer_queue (select message_id, now(), 'INSERT' from forums_messages);
insert into search_observer_queue (select live_revision, now(), 'INSERT' from ( 
  select live_revision from cr_items where content_type = 'etp_page_revision') etp);

Features

This version includes only the most basic features to prove that tsearch2 can be used for indexing. There are many configuration options that will be avaialble as parameters in the future. It is also clear that the current service contract definitions are not flexible enough to work well with every possible search driver, so some features may not be available until after the search package is also updated. Dave Bauer dave@thedesignexperience.org 2004-06-05