Last try there was a fight about syntax of introduced commands. And we (Oleg and me) developed variant of patch with another syntax. We will not change docs until agreement will be reached, current version http://mira.sai.msu.su/~megera/pgsql/ftsdoc/

Following demonstrates subset of FTS syntax using example from http://mira.sai.msu.su/~megera/pgsql/ftsdoc/fts-complete-tut.html.

Syntax which was proposed:
begin;
CREATE FULLTEXT CONFIGURATION public.pg ( LOCALE = 'ru_RU.UTF-8' ) LIKE english WITH MAP;
CREATE FULLTEXT DICTIONARY pg_dict ( OPT = 'pg_dict.txt' ) LIKE synonym;
CREATE FULLTEXT DICTIONARY en_ispell
( OPT = 'DictFile="/usr/local/share/dicts/ispell/english-utf8.dict",
         AffFile="/usr/local/share/dicts/ispell/english-utf8.aff",
         StopFile="/usr/local/share/dicts/ispell/english-utf8.stop"'
) LIKE ispell_template;
ALTER FULLTEXT DICTIONARY en_stem SET OPT='/usr/local/share/dicts/ispell/english-utf8.stop';
ALTER FULLTEXT MAPPING ON pg FOR lword,lhword,lpart_hword
                             WITH pg_dict,en_ispell,en_stem;
DROP FULLTEXT MAPPING ON pg FOR email, url, sfloat, uri, float;
end;
Patch is http://www.sigaev.ru/misc/tsearch_core-0.38.gz

Making above FTS syntax as Peter suggested, we removed unnecessary parenthesis, equal sign, OPT becomes OPTION.
begin;
CREATE FULLTEXT CONFIGURATION public.pg  LOCALE  'ru_RU.UTF-8' LIKE english WITH
 MAP;
CREATE FULLTEXT DICTIONARY pg_dict OPTION 'pg_dict.txt'  LIKE synonym;
CREATE FULLTEXT DICTIONARY en_ispell
OPTION 'DictFile="/usr/local/share/dicts/ispell/english-utf8.dict",
         AffFile="/usr/local/share/dicts/ispell/english-utf8.aff",
         StopFile="/usr/local/share/dicts/ispell/english-utf8.stop"'
LIKE ispell_template;
ALTER FULLTEXT DICTIONARY en_stem SET OPTION '/usr/local/share/dicts/ispell/engl
ish-utf8.stop';
ALTER FULLTEXT MAPPING ON pg FOR lword,lhword,lpart_hword
                             WITH pg_dict,en_ispell,en_stem;
DROP FULLTEXT MAPPING ON pg FOR email, url, sfloat, uri, float;
end;
Patch is http://www.sigaev.ru/misc/tsearch_core-0.38.1.gz

Comparing that syntaxes with current tsearch2 is placed at http://mira.sai.msu.su/~megera/pgsql/ftsdoc/fts-syntax-compare.html

So, which is syntax more attractive? And is there some another objections?


--
Teodor Sigaev                                   E-mail: [EMAIL PROTECTED]
                                                   WWW: http://www.sigaev.ru/

---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster

Reply via email to