Back to Developer Roadmap

Fulltext Search

src/data/question-groups/backend/content/fulltext-search.md

4.0671 B
Original Source

You can use the native full-text search functionality of a database, such as MySQL, Postgre or even ElasticSearch.

However, if you want to implement it yourself, the steps would be:

  • Preprocessing the text data to be searched and normalizing it by applying tokenization, stemming and removing stop words.
  • Then, implement an inverted index, somehow relating each unique word to the records that contain that word.
  • Create a search UI and normalize the input from the user in the same way the text data was normalized.
  • Then, search for each word in the database.
  • Sort the results by implementing a scoring logic based on different aspects, such as word frequency.