Advantage Concepts
Advantage Expression Engine function that evaluates a full text search (FTS) expression search condition.
CONTAINS(<field> | *, <cSearchCondition> ) -> lSearchResult
<field> | * |
The field to apply the search condition to. The asterisk (*) can be used to specify that all fields with full text search (FTS) indexes are to be searched. This parameter can be a character value or the result of some expression that returns a character value, but the search will not be optimized. For best performance, this parameter should be the asterisk or a field that has a full text search index built on it. |
<cSearchCondition> |
A valid FTS search condition. |
CONTAINS returns true (.T.) for records that meet the specified search condition.
The CONTAINS() scalar function is the interface to the Advantage full text search engine. For a complete description, see Full Text Search.
This function can be used from the Advantage CA-Clipper AXDBFCDX RDD when using server-side Advantage Optimized Filters (AX_SetServerAOF). This will evaluate the full text search condition at the server and return records that pass the condition. Full text search conditions are not evaluated at the client, so it is not possible to use CONTAINS() in client-side filters. If a function is called with a CONTAINS() expression, such as AdsEvalLogicalExpr, the return will always be TRUE. In addition, building an index using a CONTAINS() expression may provide unexpected results and is not recommended because index keys are sometimes evaluated at the client and will not produce consistent results.
Note Advantage Expression Engine functions can be used in expressions such as record filter expressions and index expressions. They are not necessarily scalars supported within SQL statements. For a list of supported SQL scalar functions, see Supported Scalar Functions.
CONTAINS( mymemo, ‘cats and dogs’ ) // returns .T. for records that have both words in mymemo field
CONTAINS( *, ‘quantum’ ) // returns .T. for records where any field with an FTS index contains the word.