Db2 Text Search arguments

Wildcard characters and their expansion limit, the case sensitivity of arguments, and argument options are different types of text search arguments that can all affect query performance.

Wildcard characters

Using a wildcard character at the beginning of a search term slows query processing. Where possible, avoid performing searches such as *search_term or ?search_term.

Wildcard expansion limit

When a query term includes a wildcard, the query term is expanded so that matching documents are retrieved. A text index collection might include more distinct matching terms than the wildcard expansion limit allows. In that case, only the subset of documents that match the already expanded terms is returned. This limitation applies to the asterisk (*) wildcard character.

By default, 1024 terms can be returned. To change this limit, specify the queryExpansionLimit parameter and a value for the parameter in the ECMTS_HOME\config\configuration.xml file. For example, to set the limit to 4096, add the following line to the file:
<queryExpansionLimit>4096</queryExpansionLimit>

Case sensitivity

Text search arguments are not case sensitive, even if you specify an exact term or phrase by using double quotation marks. For example, a search for the term "Hamlet" can return both the Shakespearean play Hamlet and hamlet, the term for a small village.

Search argument options

Search argument options are properties of the search argument. For example, in the following search query for the word bank, the options of the QUERYLANGUAGE search argument are different:
	...CONTAINS(column, 'bank', 'QUERYLANGUAGE=en_US') 
	and CONTAINS(column, 'bank', 'QUERYLANGUAGE=de_DE')...