Cloning Google Suggest With Ajaxac
To aid us in this process we will be using AjaxAC, an open-source framework written in PHP used to develop AJAX style applications. This is being developed with version 0.41 of the framework. We will aim to keep this article up-to-date with the latest version of AjaxAC, as its interface is likely to change before its first stable release.
Google Suggest is a frontend to Google which will offer suggestions to search for as you type your query. When you type a keyword, a dropdown list will appear with terms beginning with what you have typed and how many results they will yield if you select to search for them. You can use your up/down arrow keys to select one of these suggestions. Alternatively, you can use your mouse to select an option, and initiate the search by clicking on the option.
We will be implementing a clone of this application, from start to finish. This begins with setting up our frontend HTML file and CSS styles, creating our AjaxAC GoogleSuggestCloneJax application, and then linking it all together. There will be a few modifications to Google Suggest, the main one relating to the fact we don’t have an index of 8 billion pages behind us! We will use a MySQL database to fetch all the suggestion data, to demonstrate how to use MySQL in AjaxAC.