I have a website and I am using Google search widget on it. Now I would like to have, if possible, the feature "Do you mean:" as used on Amazon and Google. This feature would allow a user to search for a product and if the desired product does not exist then the search results will offer a suggestion. E.g. if a visitor is looking for a "Wonder Mop 3000", but the site is offering only "Wonder Mop 1000" then above the search results, the result will look like:
Did you mean: "Wonder Mop 1000"
---------------------------------------
Results for "Wonder Mop 3000"
...
Is this possible with google search or I will need a different search engine?
Here is an excellent, accessible article by Peter Norvig, Director of Research at Google on how to implement the "did you mean" feature in a few lines of code. It's really a great read.
http://norvig.com/spell-correct.html
Essentially you will need a 'corpus' or list of valid searches, and given a search, you will try to come up with the 'most likely' correct search. At the bottom there are links to implementations in various languages including PHP, of course. Check it out :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With