What is auto complete and auto suggest?
Auto complete and auto suggest are a user interface feature that extend search functionality. It basically makes it easier and fast for the user to search structured data.
There is sometimes a mixups between Auto complete and Auto suggest. I will try to state what comes to my mind when talking about both. I also share a fix/midification I have done for a cool auto suggest jQuery plugin.
Auto complete will consider the user input as a prefix to the query so if I type “spo”, it will return “sport” or “spook” but not “kaspomat”. In SQL term this is an equivalent to saying:
WHERE some_column_name LIKE query%
Auto suggest will consider the user input as a prefix, suffix and at any other location in the query, so if I type “spo”, it will return “sport”, “spook”, “kaspomat” and also “saspo”. In SQL term this is an equivalent to saying:
WHERE some_column_name LIKE %query%
I found a cool auto suggest project written by Drew Wilson, it was good looking and works quite well.
It had however some issues I had to resolve:
- Very little cross browser support (IE is still alive and kicking) +
- It provides a multi select functionality which enables users to select multiple items from the auto suggest box. I needed it to work with the native text box.
- The CSS needed to be tuned to work with a small and thin search box
I tried to contact drew and to merge my changes with his, but could not get a hold of him.
Lucky for us Drew released his code under the MIT open source license (good on you!). This enabled me, not only to modify his code but also, to share my modifications with you.
Auto–suggest provides a simple, elegant and cross-browser tested auto suggest functionally.
I have implemented this code on one of our new initiative – an automagic product comparison engine, in which we really needed a good auto suggest searchbox. Check it out – really hard to miss the search there.
Source code can be found in the plugin page.
Note to Drew Wilson- if you like to merge back to your code, be my guest! Also, could not access your site using Firefox 2 or IE 8, only chrome worked for me.