Hitachi

Hitachi Advanced Database Setup and Operation Guide


5.4.5 Specifying a text index for a word-context search (TEXT WORDCONTEXT)

To use word-context search, define a text index that supports word-context searches. For details about word-context search, see 2.17.4 Word-context search.

By defining a text index for a word-context search, you can reduce the number of pages to be loaded when you perform a word-context search by specifying the CONTAINS scalar function. This improves table retrieval performance.

To define a text index for a word-context search, specify TEXT WORDCONTEXT for INDEXTYPE in the CREATE INDEX statement. Specifying TEXT WORDCONTEXT is called text-index-word-context search specification.

Note

When defining a text index for a word-context search, you need to specify a value for DELIMITER (text-index delimiter specification). For details about DELIMITER, see 5.4.6 Selecting the delimiting characters for word-context searches (DELIMITER).

Important

Do not define a text index for a word-context search if you will be performing leading-match word-context searches that specify short character strings of one or two characters. Using a text index for a word-context search in this scenario will actually lower performance because the data retrieval range cannot be narrowed. If you intend to perform leading-match word-context searches that specify short character strings of one or two characters, use a search method other than a word-context search.

Note that the index data in a text index for a word-context search is larger than the index data in an ordinary text index. Therefore, before you define the text index, determine the size of the index data and confirm that the additional size will not cause any problems. For details, see 5.8.5 Determining the number of storage pages for each text index segment.

A text index for a word-context search can also be used as an ordinary text index.