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

 

Sample Calling Sequences

These calling sequences should help get you up and going as well as to demonstrate how some of the function calls for Onix are used.
 

Creating and opening then closing an  Index


ixCreateIndexManager()
ixCreateIndex()
ixOpenIndex()
ixCloseIndex()
ixDeleteIndexManager()
 
 

Opening an Index and Indexing a series of files

(each file is one record)


ixCreateIndexManager()
ixOpenIndex()
ixStartIndexingSession()
while(There are still files to index) {
    for (Every Word In Document) {
        ixIndexWord()
    }
    // Optionally store data for the record  (In this case the file name)
    ixStoreRecordData(FileName)
    if(There are more files to index) {
         ixIncrementRecord()
    }
}
ixEndIndexingSession();
ixCloseIndex();
 
 

Opening an Index and Conducting a Query


ixOpenIndex()
ixStartRetrievalSession()
printf("\nWhat would you like to search for? :");
gets(QueryString);
ixConvertQuery()
QueryResults = ixProcessQuery()

// Now you can use the following six functions to navigate the results
ixNumHits()
ixVectorCurrentHit()
ixVectorNextHit()
ixVectorPreviousHit()
ixVectorNextRecord()
ixVectorPreviousRecord()

// You can also use the following two functions if you have stored record data in your index.
ixRetrieveRecordData()
ixRetrieveMoreRecordData()

ixEndRetrievalSession()
ixCloseIndex()
 
 

Deleting a Record

(Note: You have to have a retrieval session in progress to delete a record.)

ixOpenIndex()
ixStartRetrievalSession()
ixDeleteRecordNum()
ixEndRetrievalSession()
ixCloseIndex()