?
Solved

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

Posted on 2006-06-29
5
Medium Priority
?
1,007 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
3 Comments
 
LVL 14

Accepted Solution

by:
sathyagiri earned 672 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 664 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 664 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

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Question has a verified solution.

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

Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
Instead of error trapping or hard-coding for non-updateable fields when using QODBC, let VBA automatically disable them when forms open. This way, users can view but not change the data. Part 1 explained how to use schema tables to do this. Part 2 h…
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Suggested Courses

850 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