Create synonym dictionary to add instead of replace words in PostgreSQL
NickName:gouravkr Ask DateTime:2020-04-25T01:18:19

Create synonym dictionary to add instead of replace words in PostgreSQL

I am building an application where I added a Full Text Search feature using PostgreSQL's built in FTS. The app lists Mutual Funds in India. In some cases, mutual fund companies get acquired and their name changes. I wanted to allow people to search using the old names in case they were not aware of the change. So for instance, when DHFL funds got acquired by PGIM, all funds were renamed from DHFL to PGIM.

To achieve this, I created a synonym dictionary where I added PGIM as a synonym for DHFL.

However, I discovered that this simply replaces DHFL with PGIM. Which means that some older funds, which still retain the name of DHFL, are no longer returned in my query with the word dhfl.

Is there an option where a synonym adds a word rather than replace it, such that DHFL searches for both DHFL and PGIM?

Copyright Notice:Content Author:「gouravkr」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/61413873/create-synonym-dictionary-to-add-instead-of-replace-words-in-postgresql

More about “Create synonym dictionary to add instead of replace words in PostgreSQL” related questions

Create synonym dictionary to add instead of replace words in PostgreSQL

I am building an application where I added a Full Text Search feature using PostgreSQL's built in FTS. The app lists Mutual Funds in India. In some cases, mutual fund companies get acquired and their

Show Detail

Synonym DICTIONARY for `simple` language is not working

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_syn...

Show Detail

Lexicon dictionary for synonym words

There are few dictionaries available for natural language processing. Like positive, negative words dictionaries etc. Is there any dictionary available which contains list of synonym for all dict...

Show Detail

PostgreSQL: Usage synonym dictionary as table

Is it possible use (instead text file synonym dictionary) table with two columns? Synonym dictionary often changed, regenerate dictionary and replacement impossible.

Show Detail

Synonym words are not being stemmed correctly in text search

In PostgreSQL, I have a text search configuration with a synonym dictionary and then I use the english_stem file. The problem is that for example, I have the word 'tv' as a synonym for 'television'...

Show Detail

Add dictionary file to postgresql docker container

I am using the postgresql docker image https://hub.docker.com/_/postgres/ To improve my full text search experience with a synonym dictionary according to http://www.postgresql.org/docs/9.5/inter...

Show Detail

Multiple synonym dictionary matches in full-text searching

I am trying to do full-text searching in PostgreSQL 8.3. It worked splendidly, so I added in synonym matching (e.g. 'bob' == 'robert') using a synonym dictionary. That works great too. However, I've

Show Detail

Rails Postgresql - synonym dictionary somewhat not updating

I have a Rails4 app with Postgresql(PG_search) on a MAC. I created the synonym dictionary through rails migration. The synonym dictionary is somewhat working. Setup below Migrations CREATE TEXT S...

Show Detail

How to access a SOLR-synonym dictionary from a SOLR client?

Imagine a search engine that doesn't have the word 'Iran' in the index. If a user searches for 'Iran' we have no results. We could use SOLR's spelling correction and suggest 'iron' instead. Alterna...

Show Detail

PostgreSQL showball algorithm does not work on synonyms

I created custom config and synonyms for this config. Here is my synonym_custom.syn file contents gate door These are the creation scripts: CREATE TEXT SEARCH CONFIGURATION icons (copy='engli...

Show Detail