可以在配置中把分类词典thesaurus_simple绑定到想要的记号类型上,例如:
ALTER TEXT SEARCH CONFIGURATION russian
ALTER MAPPING FOR asciiword, asciihword, hword_asciipart
WITH thesaurus_simple;
以创建名为thesaurus_astro的TZ词典为例:创建一个简单的天文学词典thesaurus_astro,其中定义了两组天文短语及其同义词如下:
CREATE TEXT SEARCH DICTIONARY thesaurus_astro (
TEMPLATE = thesaurus,
DictFile = thesaurus_astro,
Dictionary = english_stem
);
创建词典后,将其绑定到对应文本搜索配置中需要处理的词类型上:
ALTER TEXT SEARCH CONFIGURATION russian
ALTER MAPPING FOR asciiword, asciihword, hword_asciipart
WITH thesaurus_astro, english_stem;