Skip to content Skip to main navigation Skip to footer

How to set up custom search?

You can set a search for specific columns within layers through Map Editor for all your apps that have a Search tool enabled (for example, your Map Portal). Custom Search will override the GIS Cloud standard search. It works for both private or public maps and portals.

Note: To be able to set a custom search for specific columns, it is necessary to import the layer into the Database and add the layer from the Database datasource into a map.

After importing layer into the Database, follow instructions below:

1. Open map in Map Editor.

2. Find the Layer ID in Layer Properties.

3. Click More info button and copy Layer ID.

4. Under the Map tab click Map Properties and click Map Options tab.

5. In the Name box write SEARCH_FIELDS. This option instructs the search engine to search inside specific layers and attributes.

6. In the Value box open braces ({).

7. Open quotes (") and write Layer IDNote: make sure to use the correct quote symbols "value".

8. Close quotes (") and write colon after quotes (:). Line should look like this now: {"311482":

9. Open square brackets ([).

10. Open quotes (") and write the name of the column you want to search.

Note: Make sure that you write the Name of the column and not column alias. You can find the column name under the Layer Properties in the Attributes tab.

  1. Close quotes (") and square brackets (]).

Note: if you want to add more columns within one layer write comma (,) and repeat steps 10-11 i.e. {"311482": ["city","country","pop1955"]}

  1. Close braces (}).  
  2. Click the Add button.

  3.  In the next Name box write RESULT_FIELDS. This option shows which attributes will be shown inside search results.
  4. Copy and paste values from the SEARCH_FIELDS. Click the Add button and Save.
Custom_Search5

Note: Characters are case sensitive so make sure that you type the exact option and column name.

Map options should look like this:

Refresh your Map Editor or Map Portal and search for an object (GIS Cloud Search). Only columns set in the Map options should be visible.

Setting Search for more layers

It is also possible to set search for more layers in one map. To set search for more layers:

  1. Open map in Map Editor and open Map Properties – Map options.
  2. In the Value box after square brackets (]) and add comma (,).
  3. Copy Layer ID from the Layer properties.
  4. Repeat steps 7-11.
  5. Copy and paste new values both in the SEARCH_FIELDS and RESULT_FIELDS.
  6. Click Save.
  7. Refresh your map.

Was This Article Helpful?