How to implement full-text search backend in Typescript with NodeJS?

Hi guys!

I am looking forward to suggestions on implementing the backend for a full-text search functionality. The front end will feature a full-text search bar, and my goal is to extract significant words from the inputted text and match them with columns in PostgreSQL database tables. The backend is developed in Typescript with Node.js.

I have come across the idea of using NLP (Natural Language Processing) libraries for this task. I would greatly appreciate any guidance on this project. Any links or references to implementation examples would be incredibly valuable.

Thank you in advance for any assistance you can offer!

Um excuse me, but what exactly do you mean full text search functionality? And what’s this about matching them with PostgresSQL database tables? You haven’t told us anything about what you want to actually do. If you just want to find some text in a string, there’s this handy indexOf method in the String class.

Thank you for your response. The context here is a marketplace featuring a text search bar. If, for instance, the user inputs ‘green ankle boots with rubber soles and size 9’, I have a PostgreSQL DB table called ‘products’ with columns like ‘type’ (defining products as shoes, clothes, etc.), ‘specific_type’ (for sneakers, boots, sweaters, etc.), ‘size’, and so on. The task is to extract relevant keywords from the input text by excluding words like ‘with’ and ‘and’. These extracted keywords are then used to search the table’s columns, finding matches and retrieving the corresponding product data.