I am supposing that we can use this old recipe and only replace the language german
to language simple
(that is the "no language")... But it is not working.
CREATE TEXT SEARCH DICTIONARY my_synonym (
TEMPLATE = synonym,
SYNONYMS = synonym_sample
-- default /usr/share/postgresql/12/tsearch_data/synonym_sample.syn
);
CREATE TEXT SEARCH CONFIGURATION my_synonym(COPY='simple'); -- need it??
ALTER TEXT SEARCH CONFIGURATION my_synonym
ALTER MAPPING FOR asciiword, asciihword, hword_asciipart, word, hword, hword_part
WITH my_synonym -- make sense??
;
SELECT to_tsvector('my_synonym', 'Postgresql')
@@ to_tsquery('my_synonym', 'Postgresql'); -- true
SELECT to_tsvector('my_synonym', 'Postgresql')
@@ to_tsquery('my_synonym', 'pgsql'); -- false. NOTICE:
-- text-search query contains only stop words or doesn't contain lexemes, ignored
SELECT to_tsvector('my_synonym', 'Postgresql pgsql')
@@ to_tsquery('my_synonym', 'pgsql'); -- false. Same NOTICE.
The synonym_sample.syn
is described in the current Guide's 12.6.3. Synonym Dictionary section. It converts "pgsql" abbreviation into "postgres" word... So many problems
- fail, not work, not translated "pgsql" into "postgres".
- ignored "pgsql" (!)
- generates a NOTICE that not makes sense