Changeset 2699 for trunk/gsdl


Ignore:
Timestamp:
2001-08-15T10:47:08+12:00 (23 years ago)
Author:
cs025
Message:

mgpp collections now work on windows

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/src/colservr/mgppsearch.cpp

    r2697 r2699  
    7979bool mgppsearchclass::search(const queryparamclass &queryparams,
    8080                 queryresultsclass &queryresult) {
    81  
    82   char *basepath = collectdir.getcstr(); //like ...gsdl/collect/demo
    83   char *indexname = (getindexsuffix(queryparams)).getcstr(); // like ...demo/mt/demo
    84 
    85   // load index data
     81
     82  char *basepath="";
     83  char *indexname = (filename_cat(collectdir, getindexsuffix(queryparams))).getcstr();
     84
     85 // load index data
    8686  if (indexData == NULL) {
    8787    indexData = new IndexData();
     
    180180  //indexData.UnloadData(); - leave it cached for next query
    181181  delete indexname;
     182  delete basepath;
    182183  return true;
    183184
     
    188189                    queryresultsclass &queryresult) {
    189190
    190   char *basepath = collectdir.getcstr(); //like ...gsdl/collect/demo
    191   char *indexname = (getindexsuffix(queryparams)).getcstr();
     191  char *basepath = "";
     192  char *indexname = (filename_cat(collectdir, getindexsuffix(queryparams))).getcstr();
    192193 
    193194  //IndexData indexData;
     
    233234  //indexData.UnloadData();
    234235  delete indexname;
     236  delete basepath;
    235237
    236238  return true;
     
    251253                    text_t &output) {
    252254 
    253   char *basepath = collectdir.getcstr(); //like ...gsdl/collect/demo
    254 
    255   text_t textfilename = "/index/text/"+collection;
     255  char *basepath = "";
     256  char *textname = (filename_cat(collectdir, "index", "text", collection)).getcstr();;
     257 
    256258  TextData textdata;
    257   if(!textdata.LoadData(basepath, textfilename.getcstr())) {
    258     //error
     259  if(!textdata.LoadData(basepath, textname)) {
     260    cout<<"couldn't load text data\n"<<endl;
    259261    return false;
    260262  }
    261263  UCArray doctext;
    262264  UCArray level;
    263   //SetCStr(level, "Section");
    264265  SetCStr(level, gdbm_level.getcstr());
    265266  if (!GetDocText(textdata, level, (unsigned long)docnum, doctext)) {
    266     //error
     267    cout<<"couldn't retrieve document text\n";
    267268    return false;
    268269  }
     
    279280  textdata.UnloadData ();
    280281  delete basepath;
     282  delete textname;
    281283
    282284  return true;
     
    288290void mgppsearchclass::unload_database () {
    289291
    290   // not sure what needs to go in here if anything [27-7-01, kjm18]
    291 }
    292 
    293 
    294 
    295 
    296 
     292  if (indexData !=NULL) {
     293    indexData->UnloadData();
     294  }
     295}
     296
     297
     298
     299
     300
Note: See TracChangeset for help on using the changeset viewer.