Locate or insert the word and its associated bitmap, assign object id in the bitmap.

Return TypeFunction nameArguments
hzEcodehdbIndexText::Insert(hzString&,uint32_t,)

Declared in file: hzDatabase.h
Defined in file : hdbIndex.cpp

Function Logic:

0:START 1:lcword items 2:unknown 3:items 4:items rc 5:unknown 6:items 7:Return rc

Function body:

hzEcode hdbIndexText::Insert (hzString& word)uint32_t docId, 
{
   //  Locate or insert the word and its associated bitmap, assign object id in the bitmap.
   _hzfunc("hdbIndexText::Insert(int)") ;
   hzIntset    bm ;            //  The bitmap associated with the word
   hzString    lcword ;        //  The word but all in lower case
   hzEcode     rc = E_OK ;     //  Error code
   lcword = word ;
   lcword.ToLower() ;
   if (m_Keys.Exists(lcword))
       m_Keys[lcword].Insert(docId) ;
   else
   {
       bm.Insert(docId) ;
       rc = m_Keys.Insert(lcword, bm) ;
       if (rc != E_OK)
           hzerr(rc, "Failed to insert doc_id of %d into bitmap. Error=%s\n", docId, Err2Txt(rc)) ;
   }
   return rc ;
}