The Main Manual Page Dynamic API Documentation CD-ROM API Documentation About Onix Types About Onix Errors Onix's Web Site at Lextek International Lextek International Onix Full Text Indexing and Retrieval Toolkit

ixFindKey

NAME

ixFindKey -- Finds a specific word/key in the index

SYNOPSIS

void ixFindKey(OnixIndexManagerT IndexManager, DictionaryCursorT *Cursor, UCharT *Word, BooleanT *Found, ULongT *NumRecords, ULongT *NumWords, StatusCodeT *Status)

ARGUMENTS

 IndexManager -- An index manager which has an open index associated with it.

Cursor  -- A dictionary cursor of type DictionaryCursorT.  This keeps track of where you are in the indexes wordlist.

Word   -- The word to be found should be passed in here represented as a Pascal string.  (The first character gives the length.)

Found  -- Pointer to a value of type BooleanT.  If the word specified in Word is found, Found will be set to BooleanTrue otherwise it will be set to BooleanFalse.

NumRecords -- Pointer to a value of type unsigned long.  If the word was found, NumRecords will be set to the number of records in which the word occurs.

NumWords  -- Pointer to a value of type unsigned long.  If the word Word was found, NumWords will be set to the total number of times the word occurs.

Status  -- A pointer to a value of type StatusCodeT.  If an error occurs, it will be reported in Status.  Otherwise, Status will be set to a value of 0 or greater.

RETURNS

Nothing

If an error occurs, Status will be set to an error value.

DESCRIPTION

ixFindKey is used to locate a specific word in the index.  It sets the dictionary cursor Cursor to point to the word and fill in the number of times the word occurs into the variables NumRecords and NumWords.

To locate a specific word in the index, the index manager must be associated with an open index (via the ixOpenIndex() function) and a retrieval session must have been started using the function ixStartRetrievalSession().  The word must be passed in via the pointer Word which points to a Pascal string.  (A Pascal string is a string of characters where the first character gives the length of the string.  For example, the word printer would look like 7printer -- where the "7" is the character 0x07).

ixFindKey will overwrite any information which is in the dictionary cursor.  (If your application needs to keep track of more than one place in the word list, it is all right to use more than one dictionary cursor.)  If the word was found, the BooleanT variable Found will be set to BooleanTrue or BooleanFalse if the word was not found.  Furthermore, if the word Word was found, NumRecords and NumWords will be filled in with the number of records the word occurs in and the total number of times the word occurs throughout all the records.

SEE ALSO

ixCurrentKey, ixNextKey, ixPreviousKey