MAX_PREFIX_PER_CONTAINS_PHRASE Database Option

Specifies the number of prefix terms allowed in a text search expression.

Allowed Values

0 – 300

0 – no limit for prefix terms in search phrase

300 – upper limit (this is the overall limit for total number of terms allowed in a phrase)

Default

1

Scope

Requires the SET ANY PUBLIC OPTION system privilege to set this option. Can be set temporary, for an individual connection, or for the PUBLIC role. Takes effect immediately.

Description

MAX_PREFIX_PER_CONTAINS_PHRASE specifies the threshold used to disallow more than one prefix in an expression for a text search.

When this option is set to 0, any number is allowed. SAP Sybase IQ detects and reports an error, if the query has any CONTAINS expressions with a phrase having more prefix terms than specified by this option.

Examples

With the default MAX_PREFIX_PER_CONTAINS_PHRASE setting:

SET MAX_PREFIX_PER_CONTAINS_PHRASE = 1

this CONTAINS clause is valid:

SELECT ch1 FROM tab1
WHERE CONTAINS(ch1, '"concord bed* in mass"')

With the default MAX_PREFIX_PER_CONTAINS_PHRASE setting of 1, this CONTAINS clause returns a syntax error:

SELECT ch1 FROM tab1
WHERE CONTAINS (ch1, '"con* bed* in mass"')

When MAX_PREFIX_PER_CONTAINS_PHRASE is set equal to 0 (no limit) or 2, this CONTAINS clause is valid.