So I am developing a website which needs a search box in which you enter some activity like bowling, cycling etc. and to next of that there is another text box which has a location like New York City, USA or Brooklyn, NYC, USA etc. This will take me to listings that have such activities present. But I also need a way to search these particular listings. Suppose a listing is called ABC Bowling Alley, I want to be able to search that. Do I give something like search for activites on one end and search for listings on other end and separate them with an or, or do I do something else? Please suggest?
The most typical paradigm used for this case is basic/advanced search.
A basic search will simply search all relevant fields for the string. This is fast and easy for the user and should work most of the time. But it has some limitations: if you search for "bowling" it will return you bowling alleys, but also Bowling Green, Kentucky.
An advanced search allows a user to specify values/search strings for specific fields. There are various ways to implement this.
- Filtering is the most common on modern websites. There might be an expanding tree that allows you to find the activities you are interested in, and there might be an option to return results within X miles of a particular location. In addition, there is a single search box that performs a basic keyword search. It should ignore any categories that are used for filtering.
- Or you can allow the user to specify a different search string for different fields. This is not as easy to use as filtering, but it can work better if the fields contain a wide variety of data that you aren't able to fully categorize. For example, filtering on activity requires your site to have knowledge of and keep track of all activities, while this does not. This can be implemented either with:
- Multiple text fields. This is the clearest for occasional users.
- A syntax within a single search box. For example, in GMail I can type
from:[email protected]to find all messages from a particular address. This is more convenient for power users, but it won't be understandable to occasional or less technically skilled users. It needs very good documentation, or to be offered as an option in addition to multiple text fields.
Having worked on a search engine before there are some things you should consider:
- Some company names have a location name in theire company name (like "New York Bowling Centre".)
- Some companies reside in a different region than the location name in theire company name (historic name, or maybe they open up a new branch). Example: Michelin
- Weighted search will give you an index to sort by, but you have to differentiate location from company name, if you wish to show the branch closest to the user
- You need to tie your companies with locations for a "smart" search
Having thought about theese issues you can make a "quite smart" search engine, you will need only one input for search. How you do this, is to build a self improving search engine. You tie locations (lat, lng) to your companies (geolocation), also you look for patters in the searches.
If the search contains a location name, you should check if that location name resides in the end of the search string like: Mechanic New York.
If it does, you most certain know that the user wants a Mechanic in New York. However if the users searches for: New York Mechanic, he/she most likely wants a certain company called "New York Mechanic". There are many patterns like this, this is just a simple example.
But in the first example: " ", you will need both weighted search against indexes, as well as sorted by location (distance from the user). In this way they can find a local carpenter or they can find a certain carpenter :-)
It is quite hard to get this tuned in the way you want, you will need several indexes, different weighting, etc. But it's doable, even as a solo programmer.
It is a filter system that allows you to search for keywords that will set the rules for the search results. There is no need to create numerous search fields, it does the same function, rather set up the conditions. Better from UX point of view, as it less likely to confuse the user.