Home > database >  How to create new text search dictionary
How to create new text search dictionary

Time:10-19

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

CodePudding user response:

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

CodePudding user response:

Problem solved with saving .syn file from vscode.

  • Related