AdsCreateFTSIndex

Advantage Client Engine

  This is the first topic This is the last topic  

Creates a new full text search index.

Syntax

UNSIGNED32 AdsCreateFTSIndex

(

ADSHANDLE hTable,

UNSIGNED8 *pucFileName,

UNSIGNED8 *pucTag,

UNSIGNED8 *pucField,

UNSIGNED32 ulPageSize,

UNSIGNED32 ulMinWordLen,

UNSIGNED32 ulMaxWordLen,

UNSIGNED16 usUseDefaultDelim,

UNSIGNED8 *pucDelimiters,

UNSIGNED16 usUseDefaultNoise,

UNSIGNED8 *pucNoiseWords,

UNSIGNED16 usUseDefaultDrop,

UNSIGNED8 *pucDropChars,

UNSIGNED16 usUseDefaultConditionals,

UNSIGNED8 *pucConditionalChars,

UNSIGNED8 *pucCollation,

UNSIGNED8 *pucReserved,

UNSIGNED32 ulOptions

);

Parameters

For detailed descriptions of how the various parameters affect full text search indexes, see the Index Options section of Full Text Search.

hTable (I)

Handle of the table on which to create the full text search index.

pucFileName (I)

Name of file for new index order. If this is NULL or if the base name is the same as the table, then a compound AutoOpen index file for hTable will be created/updated. If no path is given, the index will be created in the same directory as the table.

pucTag (I)

Name of the new index tag.

pucField (I)

The field on which the full text search index is to be created. The allowed field types include character, cicharacter, memo, binary, image, raw, and varchar.

ulPageSize (I)

The page size to use when creating new indexes for tables of type ADS_ADT. It is ignored for tables of type ADS_CDX and ADS_VFP. Valid parameters are ADS_DEFAULT, or any numeric value in the range ADS_MIN_ADI_PAGESIZE to ADS_MAX_ADI_PAGESIZE. If ADS_DEFAULT is given, then a page size of 1024 bytes will be used. Note that this parameter is only used when creating a new index file. When this API is used to create additional index orders in an existing index file, then this parameter is ignored. See Index Page Size for more information.

ulMinWordLen (I)

The minimum word length to store in the index. Words shorter than this length will not be in the index.

ulMaxWordLen (I)

The maximum word length to store in the index. Words that are longer than this will be stored in the index in a truncated form. Searches for words longer than the maximum length will require some post-processing of the data. See the description of this option in Full Text Search.

usUseDefaultDelim (I)

If non-zero (TRUE), the default delimiters will be used as part of the delimiter set.

pucDelimiters (I)

Optional null terminated string of delimiter characters. If usUseDefaultDelim is TRUE, then these delimiters will be used in addition to the default delimiters. This parameter can be NULL or an empty string.

usUseDefaultNoise (I)

If non-zero (TRUE), use the default noise word list.

pucNoiseWords (I)

Optional null terminated string of space-delimited noise words. If usUseDefaultNoise is TRUE, then these noise words will be used in addition to the default noise words. This parameter can be NULL or an empty string.

usUseDefaultDrop (I)

If non-zero (TRUE), use default drop characters.

pucDropChars (I)

Optional null terminated string of drop characters. If usUseDefaultDrop is TRUE, then these drop characters will be used in addition to the default drop characters. This parameter can be NULL or an empty string.

usUseDefaultConditionals (I)

If non-zero (TRUE), use default conditional drop characters.

pucConditionalChars (I)

Optional null terminated string of conditional drop characters. If usUseDefaultConditionals is TRUE, then these conditional drop characters will be used in addition to the default conditional drop characters. This parameter can be NULL or an empty string.

pucCollation (I)

An optional collation language used when creating index. This parameter is optional for ADS_ADT and ADS_VFP tables, but must be NULL or empty for ADS_CDX tables. This allows the index to be created with a collation different from the one currently active on the table. See dynamic collation support.

pucReserved (I)

Reserved for future use. Pass NULL for this value.

ulOptions (I)

A bit field for defining the options for full text search index creation. The options can be ORed together into the bit field. See Full Text Search for details on the options. The options are:

ADS_DEFAULT: If no options are needed, this constant (0) can be used.

ADS_COMPOUND: Create an index order (tag) within a compound index file. Note that this option is set automatically when the table type is ADS_ADT.

ADS_FTS_FIXED: Create an FTS index that is not maintained by Advantage.

ADS_FTS_CASE_SENSITIVE: Create a case-sensitive FTS index.

ADS_FTS_KEEP_SCORE: Track word counts in the index for the SCORE() scalar function.

ADS_FTS_PROTECT_NUMBERS: Do not treat commas and periods as delimiters when they appear in numbers (digits 0-9).

Remarks

This API is only valid for table types ADS_ADT, ADS_VFP, and ADS_CDX. Full text search indexes cannot be created on tables of type ADS_NTX.

This API does not return the handle of the newly created index to the caller. It is possible to retrieve the index handle, however, FTS index handles cannot be used with most APIs. For example, it is not possible to use them for table positioning via AdsGotoTop, AdsSkip, etc. FTS indexes are used automatically when the CONTAINS() scalar function is used in filters and SQL WHERE clauses.

For a full description of FTS indexes, see Full Text Search.

See Also

AdsCreateIndex61

AdsReindexFTS

AdsGetNumFTSIndexes

AdsGetFTSIndexes

AdsGetFTSIndexInfo

AdsIsIndexFTS