How to build a free flow search on sql-server database tables?

Lokesh Agrawal :

I am creating a web application similar to quora/stackoverflow that allows users to perform CRUD operations on question bank (question bank is very small, ~500 questions with maximum 5 answers per question) along with search. How can I build a free flow search or auto suggestion functionality on question bank?

Tech Stack:

  1. Restful services for CRUD operations are exposed from Java EE (spring boot) based server hosted on tomcat.
  2. Frontend app is built using React and served from Node server.
  3. Database used is SQL Server.

Question Bank Schema:

questionId: String

tags: [String]

title: String

description: String

answernotes: [String]

applicableJobRole: [Intern, Full Time]

state: [Approved, UnderReview, Obsolete]

difficultyLevel: [Easy, Medium, Hard]

noOfTimesUsed: int

createdBy: user

Requirement:

For my web application, I want to build a free flow search or auto suggestion functionality on question bank (that searches existing questions in questionbank on fields like description, title, answer notes etc). This is to prevent duplicate questions from getting created in the question bank and to help users search similar questions.

For ex. something similar to the image below (snipped from Quora).

Questions:

  1. Is elastic search a good fit for indexing or building a search functionality for such a small data set? or,
  2. Should I build indexes using self created data structure like suffix tree in application server itself?

Are there some other quick to use recommended solutions for building free flow search functionality for such use-case?

Leads/pointers here are appreciated.

Search from Quora

micpalmia :

Should I build indexes using self created data structure like suffix tree in application server itself?

Please don't! This will take a long time and will likely be extremely error prone. Managing your indexes in the application server itself could be a viable solution, but using a library would definitely help you a lot.

While Elasticsearch is a possibility, this amount of data can easily be managed with a simple Lucene index. This decisions also depends on the redundancy you want to ensure for your system. If you are not happy with your one service being unreachable every time your one server is down, you should look at Lucene's index replication features or at using a redundant Elasticsearch installation.

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=475875&siteId=1
Recommended