Locate or insert the word and its associated bitmap, assign object id in the bitmap.
| Return Type | Function name | Arguments |
|---|---|---|
| hzEcode | hdbIndexText::Insert | (hzString&,uint32_t,) |
Declared in file: hzDatabase.h
Defined in file : hdbIndex.cpp
Function Logic:
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 ;
}