Hello there.
We maintain an inhouse system for tracking various aspects of our company and one thing thats lacing is the systems search. Im trying to replace the search system with something a bit better as the current one to be frank although works is pants.
We are using a MySQL InnoDB tables so fullsearching is a nono and what were searching is mainly addresses so keeping a full text index or search words would be pointless. A client search foer xample takes a keyword and searched the name, address and number fields for mathcing records and isplays the first 200.
I am to replace it with a keyword search so extracting keywords and doing multiple like statement. The search classes also provide the AJAX auto completes which is where the main problem comes into play.
Problem 1 ) Searching for "G" will return all records with the words GAL it will pull all records with GAL in them anywhere and in no particular order. What we want is to order the results so that when you type GAL all records starting with GAL appear first followed by say XYZGAL. Ordering by name seems to do very little. I assume something like WHERE `name` LIKE 'GAL%' or `name` LIKE `%gal%' would trigger some sort of logic but nope.
Problem 2 ) Im planning on changing to multiple keywords. Is there anyway of getting the results that contain more than one keyword at the top and then only ones with one after?
Problem 3 ) Search results only do one page using a limit. I want to do the other pages and the real snag is that users also want to sort the columns. So if you limit to 200 results and there are 500 and sort the primary key by ASC or DESC respectivly you get different results.
Is there any examples of good PHP search engines that do sorting and paging that arnt aimed at building fullkey tables used for page searching?
Start Free Trial