Creating a Search Application - Searching
(Page 20 of 29 )
So, we now have a method to populate our tables with URLs and keywords. The next thing we need to accomplish is to create a search class. Our search class will provide methods for exact keyword searching and fuzzy searching. Let's start off with an overview of how the class will be built.
Class variables - As with the harvesting class, we will have some variables in the this class to hold data that each function needs access to.Constructor - The constructor of this search class will connect to the database and then place the search terms into a class variable as an array. It will also record the number of elements in that array in another class variable.doSearch - This function provides the exact keyword matching search._highpercent - This is a private function that will be used along with an array_walk() function call._slashit - This private function will also be used for an array_walk() function call.doFuzzy - In this function we will do a fuzzy search.
Next: >>
More Database Articles Articles
More By Matt Wade