Jax2 Posted February 13, 2015 Share Posted February 13, 2015 (edited) Hi all, I need some guidance and hoping some of you might be able to point me in the right direction. I am working on a project for a client that includes a very large database of business contacts and a simple one line search box. I will explain as best I can: The database contains prefix, first name, last name, company name, company type (roofing, tiling, flooring...etc), address, city, county, zip code, phone number and other variables. The search box on the websites homepage is only one line. The pre-populated text says: Enter Business type, city, county or zipcode. The user is "supposed" to add a type of business (I.e. Roofing, tiling, dry walling ...etc) followed by either a city, a county or a zip code. I need to figure out how to take this text (I.e. Roofing macomb county, or, Roofing 48333, or Roofing Detroit) and first find all companies that match type (roofing) and then match either city, county or zipcode, depending on what the user enters. Traditionally, I have used multi-part search boxes, such as a drop down for company type, text box for city, county or zip, and assigned each as a search variable, easy stuff, but I am unsure as to how I would progress with a single text string that I'm not even sure how a customer will enter. They could, for example, type the zipcode or city first, followed by the company type (I.e. 48333 roofing) or they may not enter a company type at all, simply entering a zip code, in which case I'd have to be able to prompt them to add a company type as well so we know which companies to return. Could anyone please give me some advice on how I should start on this? I have 2 weeks to complete the entire project and this is the only area I am unfamiliar with. The rest is just a lot of coding and pretty standard. Thank you so much in advance! Edited February 13, 2015 by Jax2 Quote Link to comment https://forums.phpfreaks.com/topic/294576-in-over-my-head-need-help-with-search-algorithm/ Share on other sites More sharing options...
Psycho Posted February 13, 2015 Share Posted February 13, 2015 (edited) MySQL Natural Language Search http://www.mysqltutorial.org/mysql-natural-language-search.aspx Edited February 13, 2015 by Psycho Quote Link to comment https://forums.phpfreaks.com/topic/294576-in-over-my-head-need-help-with-search-algorithm/#findComment-1505598 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.