好的,我的问题是:我正在用法语字典使用postgresql的全文搜索,并且在我的数据库中有一些描述包含带有一个字符的名称,例如: Amphi 'A',Amphi'C,Amphi'D'... ,那么,当我使用tsvector auto创建触发器时,索姆名不会出现,Amphi AI 得到'amphi' :1'a':2但Amphi'C'是'amphi':1,没有它的名字。
Well my problem is : I am using the full-text search of postgresql with a french dictionnary, and I have in my data base some descriptions that contains names with one character for exemple : Amphi 'A' , Amphi 'C, Amphi 'D' ... well, for that, when I use tsvector auto creation trigger, somme names don't appear, for Amphi A I got 'amphi':1 'a':2 but for Amphi 'C' is 'amphi':1 without the it's name.
请帮我:D
推荐答案那是因为f.ex 。 C 和 D 被认为是
That's because f.ex. C and D considered to be stop words in the french dictionary:
SELECT to_tsvector('french', 'Amphi A'); -- 'a':2 'amphi':1 SELECT to_tsvector('french', 'Amphi C'); -- 'amphi':1您可以创建自定义字典(& a配置)而不被停止词:
You can create a custom dictionary (& a configuration for that) without stop words by:
CREATE TEXT SEARCH DICTIONARY french_stem_nostop( TEMPLATE = snowball, LANGUAGE = 'french' ); CREATE TEXT SEARCH CONFIGURATION french_nostop(COPY = french); ALTER TEXT SEARCH CONFIGURATION french_nostop ALTER MAPPING FOR asciihword WITH french_stem_nostop; ALTER TEXT SEARCH CONFIGURATION french_nostop ALTER MAPPING FOR asciiword WITH french_stem_nostop; ALTER TEXT SEARCH CONFIGURATION french_nostop ALTER MAPPING FOR hword WITH french_stem_nostop; ALTER TEXT SEARCH CONFIGURATION french_nostop ALTER MAPPING FOR hword_asciipart WITH french_stem_nostop; ALTER TEXT SEARCH CONFIGURATION french_nostop ALTER MAPPING FOR hword_part WITH french_stem_nostop; SELECT to_tsvector('french_nostop', 'Amphi C'); -- 'amphi':1 'c':2更多推荐
PostGresqL全文搜索字符问题
发布评论