错误:文本搜索配置不存在

时间:2019-03-07 09:08:58

标签: postgresql full-text-search

我正在尝试运行SQL查询,但是它以ERROR: text search configuration does not exist结尾。

如何添加自定义语言文本搜索选项?

ERROR: text search configuration "czech" does not exist
LINE 88: ts_headline('czech', title, plainto_tsquery('czech', $1)...

2 个答案:

答案 0 :(得分:4)

下载此软件包:http://www.pgsql.cz/data/czech.tar.gz

解压缩并插入到:usr / pgsql-12 / share / tsearch_data

然后以超级用户身份运行它:

CREATE TEXT SEARCH DICTIONARY cspell (template=ispell, dictfile = czech, afffile=czech, stopwords=czech);
CREATE TEXT SEARCH CONFIGURATION cs (copy=english);
ALTER TEXT SEARCH CONFIGURATION cs ALTER MAPPING FOR word, asciiword WITH cspell, simple;

那你应该没事。

来源:https://postgres.cz/wiki/Instalace_PostgreSQL#Instalace_Fulltextu

答案 1 :(得分:0)

不幸的是,PostgreSQL没有捷克语文本搜索配置。

您可以深入研究它,找到Czeck Snowball词干并将其添加到PostgreSQL中,或者使用另一种具有类似词干的斯拉夫语言。