Evaluate (search for) this composite SQL-Esce term within the supplied index and place the result in the supplied bitmap.
| Return Type | Function name | Arguments |
|---|---|---|
| hzEcode | _hz_sqle_form::Evaluate | (hzIntset&,hdbIndexText*,) |
Declared and defined in file: hdbIndex.cpp
Function Logic:
Function body:
hzEcode _hz_sqle_form::Evaluate (hzIntset& Result)hdbIndexText* pIndex,
{
// Evaluate (search for) this composite SQL-Esce term within the supplied index and place the result in the supplied bitmap.
//
// Arguments: 1) The bitmap (of document ids) to be populated by the search operation.
// 2) The index to search for this term in.
//
// Returns: E_NODATA No search term available
// E_ARGUMENT No index pointer supplied
// E_CORRUPT An error occurred during searching
// E_OK The operation was successfule (even if nothing was found)
_hzfunc("_hz_sqle_form::Evaluate") ;
hzIntset B ; // Working intermeadiate bitmap
hzEcode rc ; // Return code
Result.Clear() ;
if (!pIndex)
hzexit(E_CORRUPT, "No index supplied") ;
threadLog("Applying formula\n") ;
switch (m_eBinary)
{
case BIN_OP_SET_AND:
threadLog("Applying formula (AND) - ") ;
rc = m_pA->Evaluate(Result, pIndex) ;
if (rc != E_OK)
return hzerr(rc, "Case 1 (AND) Corruption in index") ;
if (Result.Count() > 0)
{
threadLog("%d recs with ", Result.Count()) ;
rc = m_pB->Evaluate(B, pIndex) ;
if (rc != E_OK)
return hzerr(rc, "Case 2 (AND) Corruption in index") ;
threadLog("%d recs ", B.Count()) ;
Result &= B ;
threadLog(" -> %d records total\n", Result.Count()) ;
}
break ;
case BIN_OP_SET_OR:
threadLog("Applying formula (OR) - ") ;
rc = m_pA->Evaluate(Result, pIndex) ;
if (rc != E_OK)
return hzerr(rc, "Case 1 (OR) eveluation failed") ;
threadLog("%d recs with ", Result.Count()) ;
m_pB->Evaluate(B, pIndex) ;
if (rc != E_OK)
return hzerr(rc, "Case 2 (OR) evaluation failed") ;
threadLog("%d recs ", B.Count()) ;
Result |= B ;
threadLog(" -> %d records total\n", Result.Count()) ;
break ;
}
threadLog("Found %d records in %d nodes for formula\n", Result.Count(), Result.NoNodes()) ;
return E_OK ;
}