duje.je
duje.je

Reputation: 31

How to create new text search dictionary

I want to create a new text search dictionary for PostgreSQL that will perform the recognition of synonyms. The dictionary should use .syn file. I created file in TextEdit with synonyms and saved .syn file on desktop. After that I tried to run next block of code in pgAdmin4

CREATE TEXT SEARCH DICTIONARY xy
( TEMPLATE = synonym,
SYNONYMS = 'xy.syn');

But I get ERROR: invalid text search configuration file name "xy.syn" SQL state: 22023

I can't find out what am I doing wrong? Do I have to save .syn file somewhere else or is there any way to create some kind of file with synonyms inside pgAdmin4? I am using macbook air m1

Upvotes: 0

Views: 332

Answers (2)

duje.je
duje.je

Reputation: 31

Problem solved with saving .syn file from vscode.

Upvotes: 0

Laurenz Albe
Laurenz Albe

Reputation: 247400

If the synonym file is called xy.syn, you should use SYNONYMS = 'xy' in your definition.

Upvotes: 1

Related Questions