ixCreateIndex -- Creates an empty index on the disk
void ixCreateIndex(OnixIndexManagerT IndexManager, OnixFileSpecT File, IndexModeT IndexMode, StatusCodeT *Status);
IndexManager -- IndexManager object
OnixFileSpecT -- The file name of the index.On most systems includingWindows / Unix this is
a NULL terminated string specifying the file name.IndexMode -- The mode the index will be run in.
Nothing
Status is set to an error value if there was an error condition.
ixCreateIndex() creates an empty index on disk. This "empty" index also records what type of index it is as well as various aspects of the indexes status. Needless to say, an index must be created with ixCreateIndex() before it may be opened. If you create an index with the same name as an index which already exists, the old index is removed and replaced by the new empty index.
The parameter IndexMode is important here. It determines what kind of index will be generated. A record level index will record what records a given word is in. The index size for a record level index is the smallest of all index styles available. (The actual index size heavily depends on your data and how you choose to index but typically, the resulting index can be very small.)
A word level index (WordMode) records not only what record a word occurs in but where each word occurs. This is useful for fast phrase matching, proximity searching as well as field processing. Indexes are typically larger than any of the other index modes (generally around 40-45% of the original text size) but a word level index allows for the most functionality in searching and is the most widely used of the three different search modes.
An index in IDFMode is used where you want your search results to be ranked according to projected relevance to the user. The mode the index is created in has a direct impact on index size. The index side for a IDF mode index is slightly larger than that of a record level index though not significantly so.
While the index mode is defined as an enumerated type, there may be occasions where you would want to pass in the appropriate value directly. The values are as follows:
RecordMode = 1
WordMode = 2
IDFMode = 3If the index mode is set to either WordMode or IDFMode, then the ranking method is transparently set to Method2. (This can also be set via ixCreateIndexEx() and setting ixSetRankingMethodTwo in the index creation params. )