Modifying the wildcard minimum character limits

Wildcard characters are used to match zero or more alphanumeric characters in a search term. You can configure how users complete Quick Search and Visual Queries by modifying the minimum number of characters that must be included in a search term that includes wildcards.

About this task

The following wildcard characters are available in i2 Analyze:

  • *

    Matches zero or more alphanumeric characters in this position.

    For example, the search term Tim* matches Tim, Time, and Timely.

  • ?

    Matches one alphanumeric character in this position.

    For example, the search term Tim? matches Time.

Wildcard characters can be used at any position in a search term.

Search terms with wildcard queries might result in a large number of matches, which might cause performance problems. To reduce the possible matches from a wildcard search, you can ensure that users provide a minimum number of characters with a wildcard. For example, the term "*" matches everything. If users must provide a minimum of 3 characters with an asterisk, for example the term "abc*", the number of matches is reduced to values that begin with "abc".

If the minimum number of characters is set too high, users might not be able to search for the terms that they need. For example, in a deployment where the wildcard minimum characters are configured as follows:

  • A minimum of 3 characters other than asterisks (*) must be provided in a term.

  • A minimum of 2 characters other than question marks (?) and asterisks (*) must be provided in a term.

If the user knows only 2 characters of a license plate, they might not be able to use a wildcard search:

  • If the user knows the position of the 2 characters, they can use the question mark wildcard character in the search. If the 2 characters are in positions 2 and 3, then the query "?AB*" is valid in the configuration that is described.

  • If the position of the characters is not known, the user might want to search for "*AB*", which is invalid in the configuration that is described.

In addition to wildcard characters that are specifically entered as part of Visual Query, several conditions provide implicit wildcard logic:

  • 'Starts with' - Applies an asterisk to the end of the condition. For example, 'Starts with: Fred' is equivalent to 'Fred*', which could match Fred, Frederick, or Freddie.

  • 'Ends with' - Applies an asterisk to the start of the condition. For example, 'Ends with: Fred' is equivalent to '*Fred', which could match Fred, Wilfred, or Alfred.

  • 'Contains' - Applies an asterisk to both the start and the end of the condition. For example, 'Contains: Fred' is equivalent to '*Fred*', which could match any of the above terms, but also include Alfredo.

The use of these conditions follow the same limits as wildcard characters that have been entered explicitly.

To change the minimum number of characters that must be included in a search query with a wildcard character, edit properties in DiscoServerSettingsCommon.properties.

The properties that specify the minimum number of characters for Quick Search are:

  • WildcardMinCharsWithAsterisk

    The minimum number of characters other than asterisks (*) that must be included in a wildcard query that contains an asterisk.

  • WildcardMinCharsWithQuestionMark

    The minimum number of characters other than question marks (?) and asterisks (*) that must be included in a wildcard query that contains a question mark. This value should be less than, or equal to the value of the WildcardMinCharsWithAsterisk property.

The properties that specify the minimum number of characters for Visual Query are:

  • VisualQueryWildcardMinCharsWithAsterisk

    The minimum number of characters other than asterisks (*) that must be included in a Visual Query condition that contains or implies asterisks.

  • VisualQueryWildcardMinCharsWithQuestionMark

    The minimum number of characters other than question marks (?) and asterisks (*) that must be included in a wildcard query that contains a question mark. This value should be less than, or equal to the value of the VisualQueryWildcardMinCharsWithAsterisk property.

If you follow this procedure for a deployment that provides high availability, you must complete each step on every Liberty server in your environment before you move to the next step.

Procedure

  1. Using a text editor, open the DiscoServerSettingsCommon.properties file. You can find this file in the following location: toolkit\configuration\fragments\opal-services\WEB-INF\classes.

  2. For Quick Search, edit the values of the WildcardMinCharsWithAsterisk and WildcardMinCharsWithQuestionMark properties.

  3. For Visual Query, edit the values of the VisualQueryWildcardMinCharsWithAsterisk and VisualQueryWildcardMinCharsWithQuestionMark properties.

  4. Save and close the file.

Redeploy i2 Analyze to update the application with your changes.

  1. In a command prompt, navigate to the toolkit\scripts directory.

  2. Stop Liberty:

    setup -t stopLiberty
  3. Update the i2 Analyze application:

    setup -t deployLiberty
  4. Start Liberty:

    setup -t startLiberty

What to do next

Run a selection of Quick Search and Visual Queries that use conditions including wildcard characters. Continue to change the configuration until you are satisfied with the wildcard behavior.