Ignore:
Timestamp:
2005-05-24T14:21:02+12:00 (19 years ago)
Author:
kjdon
Message:

modified the filters/sources etc so that if an indexstem is specified in the build.cfg file, then this will be used as the root of the index/gdbm filenames instead of the collection name. colleciton name still used by default. this means that we can rename a coll directory without rebuilding.

File:
1 edited

Legend:

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

    r9631 r9937  
    215215
    216216
    217 static text_t getindexsuffix (const text_t &collection,
     217text_t mgsearchclass::getindexsuffix (const text_t &collection,
    218218                  const text_t &index) {
    219219
    220220  text_t indexsuffix = "index"; 
    221221  indexsuffix = filename_cat (indexsuffix, index);
    222   indexsuffix = filename_cat (indexsuffix, collection);
     222  if (indexstem.empty()) {
     223    // no index stem, use the coll name
     224    indexsuffix = filename_cat (indexsuffix, collection);
     225  } else {
     226    indexsuffix = filename_cat (indexsuffix, indexstem);
     227  }
    223228  return indexsuffix;
    224229}
     
    243248      cache = NULL;
    244249    }
     250}
     251
     252void mgsearchclass::set_indexstem(const text_t &stem) {
     253  indexstem = stem;
     254 
    245255}
    246256
     
    264274  char *txtsuffix = (getindexsuffix (collection, "text")).getcstr();
    265275  assert (txtsuffix != NULL);
    266 
    267276#ifdef __WIN32__
    268277  char *ccollectdir = (collectdir+"\\").getcstr(); assert (ccollectdir != NULL);
Note: See TracChangeset for help on using the changeset viewer.