First released in version: 3.2 Last updated in version: 3.6

Web searches

The Web searches workspace provides configuration options to create or edit search queries for use in Web maps, Web forms and HMIs

If you have licensed the Rules engine developer, you can use the BUSINESS RULES workspace to load searches (and any dependencies, such as representations) that have been developed in other SmartSpace installations, and you can export searches you have created, for use elsewhere. See the Module import and export guide.

Displaying tag locations

From version 3.5, a built-in search is available for displaying tag locations on the web map. See Displaying tag locations on the web map for further information.

Configuring web searches

The Web searches workspace provides configuration options to create or edit search queries for use in Web maps and Web forms.

Click on WEB SEARCHES to display the workspace:

screen shot of WEB SEARCHES workspace with workflow indicated by arrows

Creating new searches follows a standard workflow as indicated in the example above. Some options are mandatory for every search; some are optional and are slightly more advanced features for creating more sophisticated search behavior. Search options are described in the following sections.

Mandatory Controls

Optional Controls

Creating a new search

To create a new search:

  1. In the Web searches workspace, double-click <Add new search>.
  2. Enter a name for the search and click Create.

    screen capture showing <Add new search> option and the Create a new search dialog

  3. Find the new search in the Searches list and click on it to update its configuration.
  4. Specify the property to use as your Primary search subject by clicking based on and choosing from the list of properties.

    screen shot showing All Assets search with its primary search subject chosen in the based on dropdown

  5. Decide how you want the search to behave when users interact with it. Select the Behavior controls you need.

    screen shot showing the behavior controls for a new search

  6. If the search is going to be displayed using the SmartSpaceweb map, add one or more Representation modes for the object.
    See Adding a representation to a type for information on adding representation modes to objects.

    screen shot showing <Add mode> option and the Choose new mode dialog

  7. Decide which properties should be displayed in the columns and rows of the summary view (see Summary view configuration) and details view (see Details view configuration) respectively.

    screen shot of dragging a property into the summary properties list

Next steps

After you have created a search, you can:

  1. Add your search to one or more roles. See The Users and roles workspace for information on assigning searches to roles.
  2. Test your search and role allocation on the web map. See Web maps at runtime.

You can also add your search definition to a new web form. See Web forms.

Filter parameters

Filter parameters with selection by user-input strings

Often you will want to search for one or more objects by a specific set of unique IDs. For example, you may wish to copy a comma-separated list of object IDs from a document directly into a search filter and have only those objects returned and displayed on the map.

For example, let’s say we wanted to search for a number of assets by their unique name property called “Asset ID”.

To do this we can:

  1. Create a general search for the Asset type using a property called Asset ID, by following the steps in Creating a new search.

  2. Double-click <Add new parameter> to add a new filter:

    screen capture showing the Add new parameter option

  3. Select the property the parameter is based on (it defaults to the primary search property) and the values to match in the property. In this example, use the primary search property, the asset id of <asset> : string. Because this search is based on the name of the primary property, you get the same results whether you select asset or string at The values matched are. When searching on complex properties or when using a property other than the primary property of the search, you may have more options here and the one you select can have an effect on the search results. See Filter parameters with grouped values and selection from a dropdown for an example.

    screen capture of filter parameters dialog: selecting the parameter the filter is based on and the values to be matched

  4. Select Enter a value and check Multiple values. This means the user will be presented with a text box where they can enter a list of asset IDs in the web map.

    screen capture of filter parameters dialog: selecting "Enter a value" and "Multiple values"

    The Multiple values check box works as follows:

    • Unchecked: the search matches all property values that contain the text entered by the user as a substring.
    • Checked: the text entered by the user is split at “,” “;” and white space, and each value is matched as a substring as above. Single or double quotes can be used to prevent splitting an identifier that contains “,” “;” or white space.

    In this example, with Multiple values checked the user can copy their comma-separated list of asset IDs providing each asset ID does not contain spaces or “;”.

  5. The values users will input are string values, in our example for the ID of the assets they want to find. We can ensure that the web map interface prompts them for the property values expected by giving the parameter a title. This determines the text prompt displayed in the input box.

    screen capture of filter parameters dialog: defining the title of a filter

When this search has been added to a role and made visible in the web map, you will see a free text input box displayed underneath the chosen search as shown below:

Filter parameters with grouped values and selection from a dropdown

You can configure a filter to group all the values returned for the subject property and present them to the user as selectable parameters. At runtime, the collection of values for that property are presented using a dropdown menu to select from. If you select the Multiple values check box the end-user can include multiple values from the dropdown menu against which results get filtered.

Note: At runtime, if an object does not have a value for the property specified in the choice parameter, it will never be returned by the search, even if no values are selected by the user.

The following example allows the instances of the Asset type to be grouped into categories identified by a 2-character code from which the user can select one or more at runtime. To do this:

  1. In the Types and objects workspace create a type called Code with a name property and add some objects:

    screen shot of instances of the Code types

  2. Again in the Types and objects workspace, add a property to the asset type with a value of type code:

    screen shot showing the Code type being added as a property of the Asset type

  3. Add some assets with different codes:

    screen shot showing assets with their code properties

  4. Create a search for the Asset type using the Asset ID property, by following the steps in Creating a new search.
  5. Double-click <Add new parameter> to add a new filter:

    screen capture showing the Add new parameter option

  6. Select the property the parameter is based on (it defaults to the primary search property) and the values to match in the property. In this example we want to group the assets by their two-character code, so select the the code of <asset> : code. Here, we are not using the primary search property and we can use either asset or code as the value to match.

    Choose code to present the user with a list of codes.

    screen capture showing how to choose the parameter for the filter and the values to be matched

  7. Select the Code of <asset> : code at Choose from and check Multiple selections. This means the user will be presented with a list of instances of the Code type that have been assigned to at least one asset. In this example, the user would be offered codes AA, BB, DD, EE but not CC which has not been used.

    screen shot of how to choose the values for user choices and multiple selections

    If, instead of selecting the code of <asset> : code, you selected the name of <code> : string the user would be presented with a list all configured codes regardless of whether they had been used.

  8. We can ensure that the web map interface shows a meaningful prompt for users by giving the parameter a title. This displays at the head of the list of selections.

    screen capture of adding a title to a parameter definition

When this search has been added to a role and made visible in the web map, you will see a list of codes for the user to select as shown below:

screen shot showing application of a filter using selecyion by a secondary property