Tsearch2 83 changes

Note: tsearch2api - Binary compatible tsearch2 API for PostgreSQL.

Read Converting tsearch2 to 8.3 by Ian Barwick

Function renaming

  • rank* functions → ts_rank*
  • parse() → ts_parse()
  • lexize() → ts_lexize()
  • headline → ts_headline
  • rewrite → ts_rewrite
  • token_type → ts_token_type
  • stat() → ts_stat()
  • tsearch2() → tsvector_update_trigger()
  • aggregate form of ts_rewrite() function was dropped

Misc

  • All data files expected in $PGROOT/share/tsearch_data/ directory
  • ispell dictionary expects '.dict,.affix' extensions !
  • stop-word file expects '.stop' extension

SQL

Use \h command in psql to show syntax of text search related SQL commands:

\h create text search 
\h alter text search
\h drop text search
event=# CREATE TEXT SEARCH DICTIONARY en_ispell (
        TEMPLATE = ispell,
        DictFile = english,
        AffFile =  english,
        StopWords = english
);
CREATE TEXT SEARCH CONFIGURATION name (
    PARSER = parser_name |
    COPY = source_config
)
event=# CREATE TEXT SEARCH CONFIGURATION public.pg ( COPY = english );