This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JDBC and the fly likes Implementing versatile text search Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Implementing versatile text search" Watch "Implementing versatile text search" New topic

Implementing versatile text search

Andrew Edwards

Joined: May 18, 2004
Posts: 10

I have an struts application that lists a large number of products held in a mysql database. Due to the large number of items I need a fairly powerful method of searching for items based on full or partial matches. Each product's detail is represented over a series of fields, i.e general description, specific description, item number etc...

I need to be able to handle users searching for something like '424 foil' where '424' may be a substring of the specific description and 'foil' may be a substring of the general description. Although not neccessary limited to just two fields. I also need to include in the results where maybe only one or two search string words were matched, that is not all of them.

I guess I would need first to parse the search string into its component words but from here on I'm not sure what's an efficient way to handle a search. I suspect some form of concurrent representation of the system product catalogue optimised for text searches would be required.

If anyone has handled something similar or heard of an approach please share

Thanks, Andrew
Loren Rosen
Ranch Hand

Joined: Feb 12, 2003
Posts: 156
You might take a look at Lucene (from Apache It uses its own datastore so you'd have to push the string fields into it.
I agree. Here's the link:
subject: Implementing versatile text search
Similar Threads
My SCEA Part 1Study Notes
a question abou making ceratain commands
3 Features of Java for Internationalization
Center text on an image
NX: Need help for GUI design