Maximum Term Length Setting (MAXIMUM TERM LENGTH)

The MAXIMUM TERM LENGTH setting specifies the maximum length, in characters, for terms inserted in the index or searched for in a full text query.

The MAXIMUM TERM LENGTH setting is used differently, depending on the term breaker algorithm. The value of MAXIMUM TERM LENGTH must be less than or equal to 60. If you set MAXIMUM TERM LENGTH lower than the MINIMUM TERM LENGTH, then MINIMUM TERM LENGTH is automatically adjusted to be equal to MAXIMUM TERM LENGTH.

The default for this setting is taken from the setting in the default text configuration object, which is typically 20.

MAXIMUM TERM LENGTH impact
To TEXT index To query terms
  • GENERIC TEXT index – for GENERIC TEXT indexes, MAXIMUM TERM LENGTH specifies the maximum length, in characters, for terms inserted in the TEXT index.
  • GENERIC TEXT index – for GENERIC TEXT indexes, query terms longer than MAXIMUM TERM LENGTH are ignored because they cannot exist in the TEXT index.
  • NGRAM TEXT index – for NGRAM TEXT indexes, MAXIMUM TERM LENGTH determines the length of the n-grams that terms are broken into. An appropriate choice of length for MAXIMUM TERM LENGTH depends on the language. Typical values are 4 or 5 characters for English, and 2 or 3 characters for Chinese.
  • NGRAM TEXT index – for NGRAM TEXT indexes, query terms are broken into n-grams of length n, where n is the same as MAXIMUM TERM LENGTH. The database server uses the n-grams to search the TEXT index. Terms shorter than MAXIMUM TERM LENGTH are ignored because they do not match the n-grams in the TEXT index.