Configuring the Quick Search

Learn to configure quick search.

The Quick Search configuration is specified using the JSON syntax. For further details, see http://www.json.org.

The default Quick Search is defined in the QuickSearch.json.js file located in the ..web\data\settings directory.

To customize the Quick Search, create your own configuration file and apply it via the Web Configuration parameter QuickSearch.Definition. For further details, see QuickSearch.Definition.

The QuickSearch.json.js file contains search providers defining the following:

  • the Quick Search drop-down list (labels, defaults)
  • the actual search definitions via AQL statements (see AQL Syntax) and/or predefined queries
    {
       searchProvider: [
          new u8.Crm.SearchProvider({
             isActive: true,
             label: u8.services.schema.idToLabelPlural("FI"),
             useFirstSearchTermForAllParameters: true,
             query: new u8.Crm.QueryCommand({
                statement: "select (Company, City, Country) from (FI as root) where (Company = '$parValue' or Synonym = '$parValue' or Country = '$parValue')",
                catalogValueEncoding: "Text"})
          }),
          new u8.Crm.SearchProvider({
             isActive: true,
             label: u8.services.schema.idToLabelPlural("MA"),
             maxRows: 10,
             query: new u8.Crm.QueryCommand({
                name: "QuickSearchPredefinedQueryName"})
          })
       ]
    }

Each search provider specifies an entry of the Quick Search drop-down list (i.e. an info area to be searched). The Select all option is hard-coded and cannot be removed.

In the BTB vertical the standard Quick Search definition contains FI, KP, MA and Y1. Y1 is not searched by default. The standard definitions for the OTC and FS verticals contain FI,KP and MA.

Note: Info areas that are locked in the current user's access rights definition are not searched.

The following parameters are used:

Name

Type

Description

isActive

boolean

Determines if the search provider is used by default (i.e. the entry in the Quick Search drop-down list is checked).

Default: false

label

string

Sets the title of the quick search result for the provider.

maxRows

int

Optional: The maximum number of rows to be displayed as a search result.

Default: 5.

If more than <maxRows> records are found, the title displays (<maxRows>+) as a hyperlink.

Clicking on the link displays all search results in a QueryRun page.

useFirstSearchTermForAllParameters

boolean

If set to true, the first search term entered is used for all search fields, e.g. to handle searches for person names consistently.

Default: false

query

u8.Crm.QueryCommand

The query that is executed (define the query as <name> or <statement>).

name

string

The name of a predefined query.

statement

string

The query statement specified using AQL, see AQL Syntax. (The $parValue object contains the search string entered by the user).

$parValue automatically adds a wildcard * at the end of the search string (string*). To enclose the search string in wildcards (*string*), use *$parValue in the query statement.

Note: *$parValue is only supported by text fields and only in AQL queries (i.e. not in predefined queries).

The Quick Search definition only supports text, number and variable catalog fields. These field types may be combined in one definition (in both the search and output fields. If an unsupported field type is used, a warning is written to the client log.

To hide the Quick Search, remove the value (path and file name) from the QuickSearch.Definition Web Configuration parameter or remove all searchProvider definitions from the *.js file.
Note: Since the Quick Search queries multiple fields from multiple info areas, make sure to use indexed fields and limit the amount of info areas and fields to avoid performance problems.