File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes designing a serch engine Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "designing a serch engine" Watch "designing a serch engine" New topic

designing a serch engine

paluri chandra

Joined: Dec 03, 2005
Posts: 4
Hi all,
I have designed a web based application using jsp,servlets & database as oracle.Now i want to have a search engine that can access tables in my database and retrieve the records.For example the user may perform search using name,emailid,phone number etc.
Please suggest how to proceed.
Mark Spritzler

Joined: Feb 05, 2001
Posts: 17276

Well, I think Lucene is for searching the pages, not the database.

But you could create a Form to take the users criteria, call a Servlet passing that criteria and the table to search on, and have a general Object that takes that information creates an SQL query and use JDBC.

Now, that is the down and dirty way, there are frameworks for this type of application, like Struts, AJAX (to do the search without refreshing the apge, if you need that), JSF, Ruby on Rails.

Hope that helps


Perfect World Programming, LLC - iOS Apps
How to Ask Questions the Smart Way FAQ
Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
You could use Lucene to "index" anything. With the API you feed it one "document" at a time. You could retrieve each database record, make a document, index it with its primary key and then use Lucene to search and get back the key. It doesn't sound real slick though; duplication of database data in an external index that you have to keep in sync doesn't feel right.

If you can get by with the database queries described above it would be a lot cleaner.

A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
I agree. Here's the link:
subject: designing a serch engine
It's not a secret anymore!