Computing.Net > Forums > Web Development > The "Did you mean" featur

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

The "Did you mean" featur

Reply to Message Icon

Name: lucym
Date: March 19, 2008 at 11:32:58 Pacific
OS: xp
CPU/Ram: barton2500/1000
Comment:

Hello, I want to add the 'did you mean' feature (like on Google) on my shareware site, where a lot of users have mistypes, and they get 0 results... so they exit the site very fast. Do you have any idea how I could implement such a thing? Does it require a dictionary or something? I found some scripts, but none of them gave relevant results... just stupid, irrelevant suggestions. Any help would be appreciated...
Thanks, Lucy



Sponsored Link
Ads by Google

Response Number 1
Name: Michael J (by mjdamato)
Date: March 19, 2008 at 14:14:47 Pacific
Reply:

Well, you should specify the type of database you are using. I will assume MySQL.

With MySQL there is a feature called full text searching that has several features - one of which is to find "close" matches and order them by relevance.

So you could do a search for 'computer' and get results such as:
- compass
- container
- colder

I *think* you can adjust the level of relevance so that you do not get results that are wildly different from the search criteria.

Here is a link to a tutorial to get you started: http://www.onlamp.com/pub/a/onlamp/...

Michael J


0

Response Number 2
Name: Laler
Date: March 19, 2008 at 14:51:57 Pacific
Reply:

This is where I first learn about it. Clean, simple, and worked (made a comment there, lol)


0

Response Number 3
Name: lucym
Date: March 20, 2008 at 08:08:24 Pacific
Reply:

Mysql I use.
If the user searchs for "conputer software", the suggestion of "compass software" or "container software" would be useless.

will now look on that link from Laler, 10x.


0

Response Number 4
Name: Michael J (by mjdamato)
Date: March 20, 2008 at 21:24:37 Pacific
Reply:

"If the user searchs for "conputer software", the suggestion of "compass software" or "container software" would be useless."

Then, what exactly do you want? you did state that " a lot of users have mistypes, and they get 0 results". The sample results I posted above presume that those two other values exist in the database. I guess I should have given an example such as:

User enters "cmputer softwaer"

Results would be:
- "Computer Software"
- "Container Software"
- etc.

Full Text Searching finds "relevant" matches and will return the results in order of their relevance.

Michael J


0

Response Number 5
Name: lucym
Date: March 21, 2008 at 06:48:54 Pacific
Reply:

yep, that's what I ment: if a user searches for "dwnload software", to be suggested the search of "download software". not related suggestions, but correct suggestions for wrong words.


0

Related Posts

See More



Response Number 6
Name: Michael J (by mjdamato)
Date: March 21, 2008 at 08:45:36 Pacific
Reply:

"not related suggestions, but correct suggestions for wrong words."

Well, a computer is not a mind-reader. It doesn't know the difference of whether the user misspelled a word or if their word doesn't exist in the database. Using Full Text Searching the system will return relevant results AND rate them with a score. It is up to YOU to decide what score constitutes a match that is worthy of showing.

A site like Google has invested many hundreds of man hours to refine their search capabilities to get the level of accuracy that they have. You should start small and refine your process as needed.

Michael J


0

Response Number 7
Name: lucym
Date: March 22, 2008 at 08:33:37 Pacific
Reply:

OK, the winner is Yahoo Spelling Suggestion ( http://developer.yahoo.com/search/w... - which uses Yahoo API). This gives your site the possibility to suggest exactly what Yahoo Search suggests :cool: Awesome, I would say!

Here is a short summary about using it, if you guys want to use it too: it requires a Yahoo API key, which can be got free. It is limited to 5000 queries per day, so I suggest caching the suggestion (which I implemented, as my site has more then 5000 searches per day). The page returned by Yahoo needs to be parsed, and see if there is a suggestion given. http://search.yahooapis.com/WebSear... is a page that gives a suggestion, http://search.yahooapis.com/WebSear... is one that has no suggestion.

You can see it live on my shareware site: http://www.coredownload.com/ try some mistypes, like "enail backup", "rgistry cleaner" or whatever you want. I also implemented a function to make bold italic the words that are different between the search query and the suggestion from Yahoo. ;)

If you need assistance on implementing this on your site, let me know.

Thanks, Lucy


0

Sponsored Link
Ads by Google
Reply to Message Icon

Create & upload my blog Copyright on pictures



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Web Development Forum Home


Sponsored links

Ads by Google


Results for: The "Did you mean" featur

Live site looks different www.computing.net/answers/webdevel/live-site-looks-different/1301.html

form processing www.computing.net/answers/webdevel/form-processing/1525.html

Help with Order Form.........HTML www.computing.net/answers/webdevel/help-with-order-formhtml/1718.html