The Search aspect of Business Directory is broken into two parts:
- The Quick Search Field, located at the top of most pages in the directory with a Search button
- The Advanced Search Page, which is opened when the user clicks on “Advanced Search” from those same pages
How Search Works
The Quick Search Box is the search on the front page of your directory (typically). It uses a keyword search function, and it will search only the titles of the listings by default. If no fields are selected, the following fields will be searched in Quick Searches: Business Name, Short Business Description, Long Business Description.
You can set this feature to search for data in additional fields by making those selections under Directory → Settings → Listings→ Searching (your list of available fields may look different from mine):
A best practice would be to choose only those fields to search where you think the most relevant search terms will be located. Usually, those are long and short description boxes, as well as the title.
Choosing too many fields for inclusion in Quick Search can result in very slow search performance.
Once that search has been performed and if no listings are found, by default the user then moves into the Advanced Search screen. The fields that have been searched for the keyword will show the keyword in them since they have already been searched. The user can then add terms in other search fields and continue searching.
If you don't want the Advanced Search to show up with the search results, you can disable that under Directory → Settings → Listings→ Searching, as shown below:
Quick Search Field vs. Advanced Search
When the user enters a keyword into the Quick Search Field and clicks search, Business Directory will attempt to match that keyword against whatever fields are set up under Directory → Settings → Listing → Searching .
By default, the search will happen by looking at the Title and Description fields of your listings. Any matches that are returned will display when you click search.
Quick Search also has optional fields that can search for locations–either City/State or ZIP/Postal code. These options are available if you have the ZIP Search and Regions modules installed.
Quick Search looks like this at the top of your directory:
Yours may look slightly different, depending on your settings. For example, if you don't have Regions installed, you won't see the “Located at City, State” field.
By contrast, the Advanced Search page has more options and when you enter data into any of the fields, the data will only be matched against that field. For example, if you enter a value in the Short Description field, no other field will be searched for that value.
Advanced Search from the demo can be accessed here and looks like this:
If you enter a value in Short Description and Title, the search will be for all listings that match the value in Short Description AND the value in Title.
Advanced Search is designed to allow finer-grained control over what you search for. The Quick Search field is a quick-and-dirty search mechanism to find the most common data in the two most heavily used fields. We avoid searching all fields for these keywords, as this would have a negative performance impact on directories with large listing counts.
Fields that have the option checked “Include this field in the search form?” are fields that will show up in the Advanced Search form here. Fields marked “In Excerpt” or “In Listing” have no effect on what displays on this page.
Listings that are “featured” will show up in the list of results at the top and with a yellow highlight color (by default). This can be changed using custom CSS with Business Directory Plugin if desired.
You can display the Quick Search Box on any page using the Quick Search Shortcode.
You can display the Quick Search Box on any page using the Advanced Search Shortcode.
Customizing Advanced Search
You can control the fields that show up in your Advanced Search Form in the form fields themselves. Fields that have the option checked “Include this field in the search form?” are fields that will show up in the Advanced Search form. To exclude a field from the Advanced Search form, uncheck this option in the field settings:
Business Directory Plugin comes with a search widget for listings in the plugin. It can be added wherever your theme allows for widgets. Find the widget under Appearance > Widgets in WordPress:
Basic Search Widget
You can simply select “Done” on this screen if you want to add a simple search widget for your directory. Here are those settings:
And here is the result on the site:
Advanced Search Widget
If you want to add additional fields to be searched, you would choose the Advanced Search button and select multiple fields to be searched. You can select more than one field by holding down the Ctrl or Cmd button on your keyboard while making those selections:
And here is what that looks like on the front-end:
You can have dropdown fields and checkbox fields here as well. You would just need to adjust the field type in the Form Fields section of the plugin.
NOTE: These search widgets only search Business Directory Plugin listings and not the entire site.
Note for users of both the Regions Module and the ZIP Search Module:
You can choose to enable the Regions Module on the Quick Search menu, which adds the Located at <City, State> search field OR you can choose to enable the ZIP Search Module on the Quick Search menu, which adds a ZIP code field to the Quick Search.
Here is what the ZIP Search Module looks like when it is enabled on the Quick Search Menu:
If you have enabled both modules in the Quick Search bar, then the Regions Module will take precedence. Only one of those options can be added to the Quick Search Bar, so you must make a choice between the two modules here.