473,406 Members | 2,633 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

The "Did you mean" feature

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... sample code would be awesome.
Thanks, Lucy
Mar 20 '08 #1
7 3877
That's no easy task! Have you considered just putting a Google search form on your site though? I.e. a form that uses Google to search just within your site. It would be a lot easier!
Mar 20 '08 #2
coolgames
169 100+
That's no easy task! Have you considered just putting a Google search form on your site though? I.e. a form that uses Google to search just within your site. It would be a lot easier!
yes, http://www.google.com/coop/cse/ that will help you (it does require some work do be done) or, you can use scripts that will be hosted right in your website like these:

http://www.thesitewizard.com/archive/searchengine.shtml
Mar 20 '08 #3
aktar
105 100+
The following functions will be of help to you. Look it up in your php manual

levenshtein()
soundex(),
similar_text(),
and metaphone().
Mar 20 '08 #4
dlite922
1,584 Expert 1GB
The following functions will be of help to you. Look it up in your php manual

levenshtein()
soundex(),
similar_text(),
and metaphone().
I was actually wondering what else is there besides soundex() , thanks for the quick and dirty list! I might use this for a government app.

DM
Mar 21 '08 #5
google custom search is not good for me... i want to display the results in my layout, using some special boxes....

anyway, am now trying levenstein, soundex, and also yahoo api. thanks.
Mar 21 '08 #6
Markus
6,050 Expert 4TB
The following functions will be of help to you. Look it up in your php manual

levenshtein()
soundex(),
similar_text(),
and metaphone().
*heads to php.net*

Thanks aktar!
Mar 21 '08 #7
OK, the winner is Yahoo Spelling Suggestion (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. This is a page that gives a suggestion, this is one that has no suggestion.

You can see it on my shareware site: link removed by moderator 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
Mar 22 '08 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

70
by: Roy Yao | last post by:
Does it mean "(sizeof(int))* (p)" or "sizeof( (int)(*p) )" ? According to my analysis, operator sizeof, (type) and * have the same precedence, and they combine from right to left. Then this...
4
by: Luke Wu | last post by:
I am just wondering what the following terms usually mean: 1) "Standard C" 2) "K&R C" 3) "ANSI C" I am pretty sure "ANSI C" usually refers to the C89 standard, but what
1
by: Colin Peters | last post by:
Hi, I'm a terrible speller. So are many people, and I think it's getting worse. That's why Googles' function to suggest re-searching with corrected misspelled words is really nice. Now I'm...
3
by: Coldman | last post by:
which was saying this: "i have an asp:repeater - its values r initialezed w/ a .DataBind() call does it mean any changes user makes on the page will automaticly go to the database? quite...
5
by: meenasamy | last post by:
Hi all i have used a script that i downloaded and uses the fopen($url,'r'); function to access a url to retrieve data and i get this error Fatal error: fopen(): Unable to find the wrapper...
17
by: arindam.mukerjee | last post by:
I was running code like: #include <stdio.h> int main() { printf("%f\n", 9/5); return 0; }
12
by: hn.ft.pris | last post by:
I know int *p mean an array of pointers to int, but I meet int (*p) which is confusing. What does it mean and how to use it? Thanks for help.
2
by: semutmerah | last post by:
hi.. my english maybe wrong.. but hope somebody can understand me :) I did created 3 forms. "MainForm" , "CalForm" , "WaitForm". On "MainForm", I did put a command button called "Run". ...
1
by: miller.paul.w | last post by:
This is a wee bit OT, but I am looking for algorithms to implement search suggestions, similar to Google's "Did you mean... ?" feature. Can anyone point me to web pages, journal articles,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.