602SQL Documentation Index  

A Size Restriction of Indexed Files

LIMITS Restriction

The LIMITS value in the SQL command CREATE or ALTER FULLTEXT must be in the following form:

    [ LIMITS 'pattern=size { , pattern=size }...' ]
while between individual components of the value (pattern, equal character (=), size, comma character (,)) must not be any spaces. The whole parameter is inserted between quotation marks.

Pattern is a prototype to which names of files that should be indexed in the fulltext system are compared. The size is a number of words. The pattern can contain special characters % and _. The % character in the compared filename matches any (even empty) substring and the _ character matches exactly one arbitrary character. These characters can be escaped within the pattern with the \ character, i.e. \% and \_ and \\ in the pattern match characters % and _ and \ in the file name. Backslash can be also used for escaping the = (equal sign) and , (comma) characters, since these characters have a special meaning in the LIMITS value.

Empty parameter (i.e. LIMITS '') in ALTER FULLTEXT cancels current setting of limits. Limits will not be considered in the following indexing, however, current fulltext system is not automatically rebuilt.

Methods of Testing

Each file that should be indexed is tested whether it matches some pattern in LIMITS. The testing takes place in a sequence in which individual patterns are written within the LIMITS value. If a file name matches certain pattern, the word count of the file is compared with the size stated for given pattern in LIMITS. If the word count is less or equal to the size stated for given pattern, the file will be indexed. Otherwise it will not be indexed. If the file name does not match this pattern, testing is going on to the next pattern (in the sequence in which the patterns are listed in LIMITS). If a file does not match any pattern, it will be indexed (i.e. if LIMITS is empty, all files will be indexed).

Method of Testing a File Name for Compliance with the Pattern

Both the pattern and the file name are split to file name and suffix - the place of separation is the last period (.) character in the pattern or in the file name. Then the filename without suffix and the suffix are compared separately. A file name matches a pattern if both the file name without suffix and the suffix match the pattern. The comparison uses the same algorithm as in the SQL operator LIKE.

If the pattern does not contain a suffix (i.e. if the pattern does not contain the period character, e.g. the "ab%cd" pattern), then the suffix can be arbitrary.

If the pattern contains period as the last character (e.g. "abc%d."), then the file suffix must be empty (i.e. the period can be only at the file name end).