Understanding Unified Search

Depending on your product, the toolbar search box may support a product specific search for business entities in addition to the standard search for menu items. For example, the search may support a query of business entities by their name, address, contact details etc. The unified search feature is a simplified version of your product’s main search, that allows the user to lookup up records using free form search text or hint codes. For more complex queries, the user may navigate to the corresponding advanced search portal.

The configuration of a unified search option includes the following items:
  • A search service script that implements the data query and defines the supported filters. The application service associated with this script is used to secure the unified search option.

  • Search filter rules and hints for the supported filters. These rules are used to parse the text entered by the user to determine whether it qualifies as a valid filter value.

  • The advanced search portal to use for more complex queries.

The unified search box interacts with a unified search option implementation as follows:
  • As the user types free form text in the search box, the application uses the search filter rules and hints to parse the entered text and translate it to corresponding query filters.

  • The search service script is then called to query for entities that match these filters and present the results.

  • Selecting a result record navigates to the corresponding portal.

  • Selecting the Advanced Search link in the search box navigates to the general query portal associated with the unified search option.

If a unified search option is not enabled for your product or the user does not have security access to it then the search box may only be used for searching the menu.

The following sections describe various aspects related to the configuration of a unified search option.

The Search Script Controls Everything

A unified search is implemented as a single service script that controls the following:

  • Filters. The script determines which filters are supported and how they are applied to return results efficiently. Each filter name must be a valid Field record.

  • Results. The script returns a list of business entities that matches the query filters provided by the user, along with the navigation information needed to drill in to a selected record in the list.

  • Application security. Only users that have access to the script's application service may use the unified search associated with the search script.

  • Override Advance Search. The script may override the advanced search portal configured for the search option.

When the search box component initializes, the script is called once in Prepare Search Details mode to return the list of supported filter names. In this mode the script does not perform any query.

As the user types in text in the search box, the search box component analyzes the entered text to derive query filters and calls the search script in Perform Search mode to return matching results.

The search box component is designed to support any type of unified search implementation and as such, the interaction between the user interface component and the search script is generic. Filters are defined as name / value pairs and results for each matched entity includes details like primary, secondary and tertiary description lines, along with a line that describes the matching text for entry.

Note: If your organization needs to implement a custom unified search script, it is strongly recommended that you follow the base product's implementation of such scripts as a reference.

Filter Rules and Hints

A unified search is designed to support a predefined set of filters for querying data. For example, searching customers by their address, name, identifiers; or searching locations by address or name etc. Each filter is uniquely identified by a Field name as declared by the search service script.

As the user types in free text in the search box, the application applies parsing rules to determine whether the text may be used as the value of one or more filters supported by the unified search. For example, if the user types in the text "ave", parsing rules may determine that it can be used to filter results by a person's name or address but not their email address.

Each parsing rule, defined in the Search Filter Rule extendable lookup, associates a filter's field name with a regular expression. Multiple filter rules defined for the same filter name are processed in execution order sequence and it is enough for one rule to return a match for the search text to be used as the value for the specific filter.

Alternatively, the user may use an explicit hint code to identify the filter they would like to use followed by the filter value. For example, an address filter may be associated with the hint "ad:" allowing the user to enter "ad: main" to look up records by address.

Each hint, defined in the Search Filter Hint extendable lookup, associates a filter's field name with a hint code.

Note that filter rules and hints are defined for a specific filter name and not a specific unified search option. The same parsing rules may be shared across searches using the same filter names. For example the parsing rule to identify an "email" filter or the "ad:" hint for an address filter are the same regardless of how these are used by a search query. These rules are automatically associated with any unified search option that uses the same filter names.

Note: You may customize the parsing rules and hints associated with a filter by inactivating the base product's extendable lookup records and introducing custom rules that match your business requirements.

Customizing Unified Search

You may customize the parsing rules and hints associated with base product search filters by inactivating the base product's extendable lookup records and introducing custom rules that match your business requirements.

If you need to support a search for different business entities and filters, you need to implement a custom unified search. The configuration of a unified search option involves the following high level steps:

  • Design and implement a search script that supports a predefined set of filters and returns the topmost set of matching results while taking into account performance considerations.

  • Design hints and filter rules as needed for each of the supported filters. Review existing hints and filter rules associated with same filter names when applicable.

  • Register each hint, if any in the Search Filter Hint extendable lookup.

  • Register each filter rule, if any in the Search Filter Rule extendable lookup.

  • Register the search script in the Unified Search extendable lookup.