Solved

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

Posted on 2006-06-29
5
986 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

When table data gets too large to manage or queries take too long to execute the solution is often to buy bigger hardware or assign more CPUs and memory resources to the machine to solve the problem. However, the best, cheapest and most effective so…
Your data is at risk. Probably more today that at any other time in history. There are simply more people with more access to the Web with bad intentions.
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…
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…

724 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