I\'m trying to come up with the fastest way to make search suggestions. At first I thought a Levenstein UDF function combined with a mysql table would do the job. But using
You could just log every search query that's entered, along with a next search query that the user enters.
Lets assume that lots of users search for rhinosorous but actually mean rhinoceros. Because users will correct their query, this will mean there will be a lot of rhinosorous queries with rhinoceros as the next query.
You can select suggestions like this:
SELECT id, query, next_query, COUNT(id) AS count FROM queries GROUP BY query ORDER BY COUNT(id) DESC
If the top result has a count
that's a high % of all queries for that keyword, display a message.
I haven't tested this, its just an idea.