Create your dictionary for text search and configuration:
CREATE TEXT SEARCH DICTIONARY simple_english
(TEMPLATE = pg_catalog.simple, STOPWORDS = english);
CREATE TEXT SEARCH CONFIGURATION simple_english
(copy = english);
ALTER TEXT SEARCH CONFIGURATION simple_english
ALTER MAPPING FOR asciihword, asciiword, hword, hword_asciipart, hword_part, word
WITH simple_english;
It works as follows:
SELECT to_tsvector('simple_english', 'many an ox eats the houses');
┌─────────────────────────────────────┐
│ to_tsvector │
├─────────────────────────────────────┤
│ 'eats':4 'houses':5 'many':1 'ox':3 │
└─────────────────────────────────────┘
(1 row)
You can set the parameter default_text_search_configto simple_englishto make it the default text search configuration.
source
share