Evaluate (search for) this composite SQL-Esce term within the supplied index and place the result in the supplied bitmap.

Return TypeFunction nameArguments
hzEcode_hz_sqle_form::Evaluate(hzIntset&,hdbIndexText*,)

Declared and defined in file: hdbIndex.cpp

Function Logic:

0:START 1:items 2:unknown 3:items 4:items 5:m_eBinary 6:BIN_OP_SET_AND 7:items rc 8:unknown 9:Return hzerr(rc,Case 1 (AND) Corruption in index) 10:unknown 11:items rc 12:unknown 13:Return hzerr(rc,Case 2 (AND) Corruption in index) 14:items Result items

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 ;
}