Written by:
Naimh
Last updated: 19/05/2021 21:12:20

Add a Custom Search Bar With Categorised Results

Enterprise and professional users can customise their own address search bar. This feature is very powerful allowing users to design custom searches that can be applied to different maps. The search support result categorisation allows for easy handling of thousands of results.

Time to complete:  15 mins

Contents

1.      Getting started

2.      Creating your custom search

2.1.   Search name

2.2.   Schema

2.3.   Table

2.4.   Columns to search

2.5.   Columns to return

2.6.   Order results by

2.7.   Categorize results by

2.8.   Geometry

2.9.   Your completed form

3.      Adding your custom search to your map

3.1.   Configure search address provider

3.2.   Complete custom search set-up

1.      Getting started

Navigate to the ADMIN section of the site and choose SEARCH MANAGEMENT. 


 

You will be presented with the available address searches on your account.  Click the ADD CUSTOM SEARCH button.



2.     Creating your custom search

This will open a form allowing you to define your custom search. You must choose an existing database connection. This can be created in the external data tool, or alternatively you can choose the default option. Within the form there are a number of selections to be made.

2.1.   Search name

Create a SEARCH NAME to help you identify it later.

2.2.   Schema

Choose database SCHEMA – this will usually be public.

2.3.   Table

Choose TABLE to search, i.e. the layer.

2.4.   Columns to search

Select COLUMNS TO SEARCH – which fields do you want the user to be able to search through.

2.5.   Columns to return

Select COLUMNS TO RETURN - the first column selected will be the primary column displayed in the search result, other columns returned will be displayed with less prominence.  It’s best to choose the least amount possible to keep search results concise. If you’re planning to categorize your results, the attribute you want to use to categorize will also be added in here.

2.6.   Order results by

Select ORDER RESULT BY – an optional field that will automatically sort your results in alphabetical order based on this option.

2.7.   Categorize results by

Select the optional CATEGORIZE RESULTS BY column – this will allow you to display your results in categories if it’s applicable to your data.  This works best if you have data that’s grouped in some way (i.e. if one of your attributes is a drop-down menu to choose).

In this example I have chosen the field ‘Type’ as it’s the only attribute with a drop-down menu for the user to choose from, and easily categorizes every entry.

Additionally, you also need to ensure that the ‘Type’ attribute is listed in the COLUMNS TO RETURN field.


In the below example, when I type in the word ‘high’, a number of results are returned under several categories including ‘Restaurant’, ‘Café’, ‘Pub’ and ‘Other’.



If we expand out one of the categories, we can see all the listings below it, as shown in this screenshot:

2.8.   Geometry

Select GEOMETRY column (auto selected)

2.9.   Your completed form

Click SAVE when you’re happy with your choices

Here’s what your completed form will look like.

3.      Adding your custom search to your map

3.1.   Configure search address provider

The newly created custom search will appear in the ‘Address Search Provider’ list. Custom searches can be edited or deleted at any time.

Make sure to enable it and press the UPDATE button.


3.2.   Complete custom search set-up

To complete your custom search setup, navigate to the EDIT MAP CONFIGURATION section of the MAP PORTAL. (Edit the map you want to add your newly created custom search to).

Towards the bottom of the page you’ll find an ADDRESS TYPE drop-down menu.  Select the name of the custom search that you’ve just created and SAVE.


If you access your map and refresh it, your customised search bar will be ready to use and will hopefully look something like below.

Enjoy creating a customised search bar for your map, and if you have any further questions regarding what you've just read please contact the Azimap Help Desk.