Skip to content

Instantly share code, notes, and snippets.

@dcuadraq
Last active January 24, 2017 17:15
Show Gist options
  • Save dcuadraq/74acfff56d31e817c84c23cdd0eed304 to your computer and use it in GitHub Desktop.
Save dcuadraq/74acfff56d31e817c84c23cdd0eed304 to your computer and use it in GitHub Desktop.
pg_search multilanguage support

Gem for searches using Postgresql.

Uses a dictionary to know the synonyms.

Query to get all currently available dictionaries

SELECT dictname FROM pg_catalog.pg_ts_dict; # or \dF

Query to get current default configuration

SHOW default_text_search_config;

To replace the default with another, run:

ALTER DATABASE postgresql_book SET default_text_search_config = 'pg_catalog.english';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment