Multiple synonym dictionary matches in PostgreSQL full text searching
- by Ryan VanMiddlesworth
I am trying to do full text searching in PostgreSQL 8.3. It worked splendidly, so I added in synonym matching (e.g. 'bob' == 'robert') using a synonym dictionary. That works great too. But I've noticed that it apparently only allows a word to have one synonym. That is, 'al' cannot be 'albert' and 'allen'.
Is this correct? Is there any way to have multiple dictionary matches in a PostgreSQL synonym dictionary?
For reference, here is my sample dictionary file:
bob robert
bobby robert
al alan
al albert
al allen
And the SQL that creates the full text search config:
CREATE TEXT SEARCH DICTIONARY nickname (TEMPLATE = synonym, SYNONYMS = nickname);
CREATE TEXT SEARCH CONFIGURATION dxp_name (COPY = simple);
ALTER TEXT SEARCH CONFIGURATION dxp_name ALTER MAPPING FOR asciiword WITH nickname, simple;
What am I doing wrong? Thanks!