tsearch_core for inclusion

Поиск
Список
Период
Сортировка
От Teodor Sigaev
Тема tsearch_core for inclusion
Дата
Msg-id 45F971B2.5060208@sigaev.ru
обсуждение исходный текст
Ответы Re: tsearch_core for inclusion  (Robert Treat <xzilla@users.sourceforge.net>)
Список pgsql-hackers
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: teodor@sigaev.ru
  WWW: http://www.sigaev.ru/
 


В списке pgsql-hackers по дате отправления:

Предыдущее
От: "A.M."
Дата:
Сообщение: Re: My honours project - databases using dynamically attached entity-properties
Следующее
От: Gregory Stark
Дата:
Сообщение: Re: My honours project - databases using dynamically attached entity-properties