Using Indexing Modes


An indexing mode is a collection of settings in the policy style file (style.plc) that affects Verity engine's indexing behavior. An indexing mode affects the engine's performance during indexing as well as the layout of the index data in a collection.

The Verity engine has many built-in modes to support different indexing behaviors. To use one of the built-in modes, you specify the mode name as an input argument to an indexer. Mode names are case-insensitive.

The method for implementing an indexing mode varies depending on the application:.

The style.plc file must be stored in a custom style directory that is specified at indexing time using mkvdk -style or the VdkCollectionOpenArgRec.style member (using the VDK API).

For more information on defining custom indexing modes, see the section, "Custom Indexing Modes" later in this chapter.

Using the Verity API

When developing an indexing application using the VDK API, your application can specify the indexing mode when it calls VdkCollectionOpen. The mode field in the VdkCollectionOpenArgRec structure should point to a string that contains the name of the mode to use while indexing.

For example, this sample code shows how to use the bulkload mode:


{
VdkCollectionOpenArgRec openRec;
VdkStructInit(&openRec);
...
openRec.path = "mycollection";
openRec.mode = "bulkload";
...
VdkCollectionOpen(session, &collection, &openRec);
}
You can change an indexing mode after the collection has been opened, using VdkCollectionSetInfo.

Using mkvdk

Use the -mode option with mkvdk to set a policy mode, as follows:

mkvdk -collection coll -mode BulkLoad -insert -bulk bulkfile

where coll is a collection name and bulk file is the bulk load file.





Copyright © 2002, Verity, Inc. All rights reserved.