Changeset 2697 for trunk/gsdl
- Timestamp:
- 2001-08-13T13:13:06+12:00 (23 years ago)
- Location:
- trunk/gsdl/src/colservr
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/src/colservr/mgppsearch.cpp
r2679 r2697 63 63 cache = NULL; 64 64 } 65 66 if (indexData !=NULL) { 67 indexData->UnloadData(); 68 delete indexData; 69 indexData = NULL; 70 } 71 65 72 } 66 73 … … 77 84 78 85 // load index data 79 IndexData indexData; 80 if (!indexData.LoadData (basepath, indexname)) { 86 if (indexData == NULL) { 87 indexData = new IndexData(); 88 } 89 if (!indexData->LoadData (basepath, indexname)) { 81 90 cerr<<"couldn't load index data\n"<<endl; 82 91 return false; … … 126 135 127 136 // do the query 128 MGQuery( indexData, queryInfo, queryTree, queryResult, level);137 MGQuery(*indexData, queryInfo, queryTree, queryResult, level); 129 138 130 139 … … 169 178 } 170 179 // clean up 171 indexData.UnloadData();180 //indexData.UnloadData(); - leave it cached for next query 172 181 delete indexname; 173 182 return true; … … 182 191 char *indexname = (getindexsuffix(queryparams)).getcstr(); 183 192 184 IndexData indexData; 185 if (!indexData.LoadData (basepath, indexname)) { 193 //IndexData indexData; 194 if (indexData == NULL) { 195 indexData = new IndexData(); 196 } 197 if (!indexData->LoadData (basepath, indexname)) { 186 198 cerr<<"couldn't load index data\n"<<endl; 187 199 return false; … … 205 217 206 218 // do the actual query 207 MGBrowseQuery( indexData, level, browseNode, browseResult);219 MGBrowseQuery(*indexData, level, browseNode, browseResult); 208 220 209 221 // load results into term info … … 219 231 } 220 232 // clean up 221 indexData.UnloadData();233 //indexData.UnloadData(); 222 234 delete indexname; 223 235 -
trunk/gsdl/src/colservr/mgppsearch.h
r2679 r2697 31 31 32 32 #include "search.h" 33 #include "IndexData.h" 33 34 34 35 class mgppsearchclass : public searchclass { … … 38 39 39 40 virtual text_t get_mg_type() {return "mgpp";} 40 41 41 42 // the search results are returned in queryresults 42 43 // search returns 'true' if it was able to do a search … … 75 76 */ 76 77 void set_gdbm_level(text_t &level); 77 78 78 79 // used to clear any cached databases for persistent versions of 79 80 // Greenstone like the Windows local library 80 81 void unload_database (); 81 82 82 protected: 83 83 text_t gdbm_level; // the level used in gdbm file (usu. Section, but may be 84 84 // Document) 85 86 IndexData *indexData; // the index data structure needed for MGQuery - keep 87 // as a cache 85 88 86 89 };
Note:
See TracChangeset
for help on using the changeset viewer.