TEXT   23
InvFPPushIndex
Guest on 11th March 2023 12:50:18 PM


  1. InvFPPushIndex *regIndex = new InvFPPushIndex(indexname, memorysize, maxfilesize);
  2. InvFPPushIndex *onedocIndex = new InvFPPushIndex(indexname, memorysize, maxfilesize);
  3.  
  4. ...
  5. onedocIndex->beginDoc(documentprops);    
  6.  
  7. while (moreTokens()) {
  8.   switch (token) {
  9.   case DOCID:
  10.     // close out the previous
  11.     if (!firstDocument()) {
  12.       setEndDocumentProps(documentprops)
  13.       regIndex->endDoc(documentprops);
  14.     }
  15.     // start a new document
  16.     setNewDocumentProps(documentprops)
  17.     regIndex->beginDoc(documentprops);
  18.     break;
  19.   case TERM:
  20.     setTermInformation(invfpterm);                     
  21.     regIndex->addTerm(invfpterm);                              
  22.     onedocIndex->addTerm(invfpterm);                           
  23.   break;
  24. }
  25.  
  26. regIndex->endCollection(collectionprops);
  27. onedocIndex->endDoc(documentprops);
  28. onedocIndex->endCollection(collectionprops);

Raw Paste

Login or Register to edit or fork this paste. It's free.