metaminded / etikett

MIT License
0 stars 0 forks source link

Exact naming of the ispell dictionaries matters #4

Closed msievers closed 10 years ago

msievers commented 10 years ago

tl;dr;

Lowercase filenames of the ispell dictionaires, because postgres does not find them with uppercased parts. Tested on ubuntu 14.04.

Details

In etikett/db/migrate there are two dictionary files named

The corresponding migration which depends on these files beeing copied to `#{pg_config --sharedir}" has this sql statement

execute("CREATE TEXT SEARCH DICTIONARY german_ispell (TEMPLATE = ispell, dictfile = de_DE_frami,afffile = de_DE_frami,StopWords = german);")

Issueing this command with psql on a database named foo gives an error, saying the the dictionary files cannot be found, although they are in place.

msievers commented 10 years ago
foo=# CREATE TEXT SEARCH DICTIONARY german_ispell (TEMPLATE = ispell, dictfile = de_DE_frami,afffile = de_DE_frami,StopWords = german);

ERROR: could not open dictionary file "/usr/share/postgresql/9.3/tsearch_data/de_de_frami.dict": No such file or directory
/usr/share/postgresql/9.3/tsearch_data$ sudo mv de_DE_frami.dict de_de_frami.dict
foo=# CREATE TEXT SEARCH DICTIONARY german_ispell (TEMPLATE = ispell, dictfile = de_DE_frami,afffile = de_DE_frami,StopWords = german);

ERROR: could not open affix file "/usr/share/postgresql/9.3/tsearch_data/de_de_frami.affix": No such file or directory
/usr/share/postgresql/9.3/tsearch_data$ sudo mv de_DE_frami.affix de_de_frami.affix
foo=# CREATE TEXT SEARCH DICTIONARY german_ispell (TEMPLATE = ispell, dictfile = de_DE_frami,afffile = de_DE_frami,StopWords = german);

CREATE TEXT SEARCH DICTIONARY
msievers commented 10 years ago

Wie man sieht, schnallt Postgres es nicht, wenn die Dateien da sind, aber z.B. de_DE_ heißen, obwohl man im SQL Statement de_DE_ geschrieben hat.

Es hilft, die Dateinamen komplett zu downcasen.

Crunch09 commented 10 years ago

Thank you, but dictionaries are also gone now.