postgresqlfull-text-searchdata-dictionary

Use Thesaurus as Dictionary for Synonyms in FTS?


As I understood, the function of this dictionaries are the same, except that Synonyms Dict do not support operation with phrases.

Is It OK to use one dictionary for thesaurus and phrases in PostgreSQl full text search?

my_custom.ths

# synonyms
postgres : pgsql
postgresql : pgsql
postgre : pgsql
gogle : googl

# phrases
indices : index*
supernovae stars : sn
crab nebulae : crab

Solution

  • Yes, you can do that. As the documentation explains:

    PostgreSQL's current implementation of the thesaurus dictionary is an extension of the synonym dictionary with added phrase support.