I have a database with 2 tables : products, and synonyms. When a user type one or several words to search in the products.description field, I would like to search for all the synonyms/substitutions as well.
The synonyms table is basic, and have to columns : word1 and word2. Example of its content :
- chiptune <-> 8bit
- lofi <-> lo-fi
- lo-fi <-> 8bit
In SQL, How can I present to the user results feturing the word "lofi" when he type "chiptune"? What I am trying to achieve is a "loop between synonyms", in both ways.
Thank you if you have some thoughts.