Solved

Optimize Search Query for considering singular, plural and suggest words like Google

Posted on 2006-06-29
5
946 Views
Last Modified: 2008-03-10
Hi,

How do I make a search query to include both singular and plural in a single query. Giving the query using: like '%  %' does not help here. If i give either "House" or "Houses" in my search criteria, it should search for both "House" and "Houses" in the database.

Also, how do I achieve something like that in Google. When we type something wrong, it asks for "Do you mean ....... to search".

Thanks
0
Comment
Question by:akshay_sumeru
5 Comments
 
LVL 14

Accepted Solution

by:
sathyagiri earned 168 total points
ID: 17009053
You could use some thing like

select * from <tname> where column_name = 'HOUSE' or column_name like 'HOUSE_';

For auto suggesting you could probably do something like

select * from <tname> where column_name like 'H%';  (you could change H% to HO% or anything else)

Whatever the result of the above query is you could display to the user and ask them to select one.

0
 
LVL 3

Assisted Solution

by:cdemir
cdemir earned 166 total points
ID: 17009906
>>Also, how do I achieve something like that in Google. When we type something wrong, it asks >>for "Do you mean ....... to search".

you can use SOUNDEX function fot this facility.
0
 
LVL 75

Assisted Solution

by:Anthony Perkins
Anthony Perkins earned 166 total points
ID: 17015080
It really depends on your database.  If it is MS SQL Server you would use Full-Text Search for that.
0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Database tuning – How to start and what to tune. This question is frequently asked by many people, both online and offline. There is no hard and fast rule-of-thumb for performance tuning, however, before beginning the tuning process one should a…
Creating and Managing Databases with phpMyAdmin in cPanel.
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

943 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

1 Experts available now in Live!

Get 1:1 Help Now