Created
July 16, 2020 22:48
-
-
Save Turupawn/96cac22337d165b885e3b19a028c2de1 to your computer and use it in GitHub Desktop.
pgsearch custom dictionary & configuration
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 1. Create config | |
CREATE TEXT SEARCH CONFIGURATION public.my_config ( COPY = pg_catalog.spanish ); | |
# 2. Create dictionary | |
CREATE TEXT SEARCH DICTIONARY public.my_dict ( TEMPLATE = pg_catalog.simple, STOPWORDS = russian); | |
# 3. Alter config | |
ALTER TEXT SEARCH CONFIGURATION public.my_config ALTER MAPPING FOR asciiword, asciihword, hword_asciipart, hword, hword_part, word WITH my_dict; | |
# 4. ???? | |
CREATE INDEX body_idx ON comments USING gin (to_tsvector('german_nostop', body)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment