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
- *
- 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".
- 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 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.
- '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.
To change the minimum number of characters that must be included in a search query with a wildcard character, edit properties in DiscoServerSettingsCommon.properties.
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.
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.
Procedure
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.