Changeset 9937
- Timestamp:
- 2005-05-24T14:21:02+12:00 (19 years ago)
- Location:
- trunk/gsdl/src/colservr
- Files:
-
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/src/colservr/browsefilter.cpp
r9620 r9937 64 64 } 65 65 66 void browsefilterclass::configure (const text_t &key, const text_tarray &cfgline) { 67 filterclass::configure (key, cfgline); 68 if (key == "indexstem") { 69 indexstem = cfgline[0]; 70 } 71 } 72 66 73 bool browsefilterclass::init (ostream &logout) { 67 74 outconvertclass text_t2ascii; … … 69 76 if (!filterclass::init(logout)) return false; 70 77 78 if (indexstem.empty()) { 79 indexstem = collection; 80 } 71 81 // get the filename for the database and make sure it exists 72 gdbm_filename = filename_cat(gdbmhome, "collect", collection, "index", "text", collection);82 gdbm_filename = filename_cat(gdbmhome, "collect", collection, "index", "text", indexstem); 73 83 74 84 if (littleEndian()) gdbm_filename += ".ldb"; -
trunk/gsdl/src/colservr/browsefilter.h
r1285 r9937 39 39 protected: 40 40 text_t gdbm_filename; 41 text_t indexstem; 41 42 gdbmclass *gdbmptr; 42 43 … … 44 45 browsefilterclass (); 45 46 virtual ~browsefilterclass (); 47 48 // configure should be called once for each configuration line 49 // default configures the default filter options 50 virtual void configure (const text_t &key, const text_tarray &cfgline); 46 51 47 52 // the gdbmptr remains the responsability of the calling code and -
trunk/gsdl/src/colservr/collectset.cpp
r9631 r9937 123 123 124 124 mgppsearch = new mgppsearchclass(); 125 125 126 126 // add a query filter 127 127 mgppqueryfilterclass *queryfilter = new mgppqueryfilterclass(); -
trunk/gsdl/src/colservr/gdbmsource.cpp
r9620 r9937 66 66 languagemap.importmap (cfgline); 67 67 68 } else if (key == "defaultlanguage") 68 } else if (key == "defaultlanguage") { 69 69 languagemap.from2to (cfgline[0], defaultlanguage); 70 } else if (key == "indexstem") { 71 indexstem = cfgline[0]; 72 } 73 70 74 } 71 75 … … 110 114 111 115 // get the filename for the database and make sure it exists 112 gdbm_filename = filename_cat(gdbmhome, "collect", collection, "index", "text", collection); 116 if (indexstem.empty()) { 117 indexstem = collection; 118 } 119 gdbm_filename = filename_cat(gdbmhome, "collect", collection, "index", "text", indexstem); 113 120 if (littleEndian()) gdbm_filename += ".ldb"; 114 121 else gdbm_filename += ".bdb"; -
trunk/gsdl/src/colservr/gdbmsource.h
r9345 r9937 43 43 text_t collection; 44 44 text_t collectdir; 45 45 46 46 // these maps are only needed to convert the default indexes 47 47 stringmap indexmap; … … 52 52 text_t defaultsubcollection; 53 53 text_t defaultlanguage; 54 55 text_t indexstem; 54 56 55 57 text_t parentOID; -
trunk/gsdl/src/colservr/lucenesearch.cpp
r9915 r9937 46 46 47 47 48 static text_tgetindexsuffix(const queryparamclass &qp) {48 text_t lucenesearchclass::getindexsuffix(const queryparamclass &qp) { 49 49 text_t indexsuffix = "index"; 50 50 // get the first char of the level to be the start of the index name -
trunk/gsdl/src/colservr/lucenesearch.h
r9189 r9937 81 81 82 82 text_t gdbm_level; // the default level used for retrieval, and in the gdbm file 83 83 protected: 84 text_t getindexsuffix(const queryparamclass &qp); 84 85 }; 85 86 -
trunk/gsdl/src/colservr/mgppqueryfilter.cpp
r9620 r9937 111 111 } else if (key == "textlevel") { 112 112 ((mgppsearchclass *)textsearchptr)->set_gdbm_level( cfgline[0]); 113 } else if (key == "indexstem") { 114 ((mgppsearchclass *)textsearchptr)->set_indexstem (cfgline[0]); 113 115 } 114 116 -
trunk/gsdl/src/colservr/mgppsearch.cpp
r9631 r9937 35 35 36 36 37 static text_t getindexsuffix(const queryparamclass &qp) { 38 text_t indexsuffix = "index"; 39 text_t ind = qp.index; 40 text_t sub = qp.subcollection; 41 text_t lang = qp.language; 42 43 indexsuffix = filename_cat(indexsuffix, ind + sub + lang, qp.collection); 37 text_t mgppsearchclass::getindexsuffix(const queryparamclass &qp) { 38 return getindexsuffix(qp.collection, qp.index+qp.subcollection+qp.language); 39 40 } 41 42 text_t mgppsearchclass::getindexsuffix (const text_t &collection, 43 const text_t &index) { 44 45 text_t indexsuffix = "index"; 46 indexsuffix = filename_cat (indexsuffix, index); 47 if (indexstem.empty()) { 48 // no index stem, use the coll name 49 indexsuffix = filename_cat (indexsuffix, collection); 50 } else { 51 indexsuffix = filename_cat (indexsuffix, indexstem); 52 } 44 53 return indexsuffix; 45 46 54 } 47 55 … … 75 83 void mgppsearchclass::set_gdbm_level(const text_t &level) { 76 84 gdbm_level = level; 85 86 } 87 void mgppsearchclass::set_indexstem(const text_t &stem) { 88 indexstem = stem; 77 89 78 90 } … … 282 294 char basepath[] = "/"; 283 295 #endif 284 char *textname = (filename_cat(collectdir, "index", "text", collection)).getcstr();;296 char *textname = (filename_cat(collectdir, getindexsuffix(collection, "text"))).getcstr(); 285 297 286 298 TextData textdata; -
trunk/gsdl/src/colservr/mgppsearch.h
r8024 r9937 75 75 char *&UDoc, int &ULen); 76 76 */ 77 77 78 void set_gdbm_level(const text_t &level); 79 80 void set_indexstem(const text_t &indexstem); 78 81 79 82 // used to clear any cached databases for persistent versions of … … 81 84 void unload_database (); 82 85 protected: 86 83 87 text_t gdbm_level; // the default level used for retrieval, and in the gdbm file 84 88 text_t indexstem; // the stem of the index file names 85 89 IndexData *indexData; // the index data structure needed for MGQuery - keep 86 90 // as a cache 91 92 text_t getindexsuffix(const queryparamclass &qp); 93 text_t getindexsuffix (const text_t &collection, const text_t &index); 87 94 88 95 }; -
trunk/gsdl/src/colservr/mgqueryfilter.cpp
r9620 r9937 92 92 maxnumeric = cfgline[0].getint(); 93 93 } 94 else if (key == "indexstem") { 95 ((mgsearchclass *)textsearchptr)->set_indexstem (cfgline[0]); 96 } 97 94 98 } 95 99 -
trunk/gsdl/src/colservr/mgsearch.cpp
r9631 r9937 215 215 216 216 217 static text_tgetindexsuffix (const text_t &collection,217 text_t mgsearchclass::getindexsuffix (const text_t &collection, 218 218 const text_t &index) { 219 219 220 220 text_t indexsuffix = "index"; 221 221 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 } 223 228 return indexsuffix; 224 229 } … … 243 248 cache = NULL; 244 249 } 250 } 251 252 void mgsearchclass::set_indexstem(const text_t &stem) { 253 indexstem = stem; 254 245 255 } 246 256 … … 264 274 char *txtsuffix = (getindexsuffix (collection, "text")).getcstr(); 265 275 assert (txtsuffix != NULL); 266 267 276 #ifdef __WIN32__ 268 277 char *ccollectdir = (collectdir+"\\").getcstr(); assert (ccollectdir != NULL); -
trunk/gsdl/src/colservr/mgsearch.h
r8024 r9937 86 86 void unload_database (); 87 87 88 void set_indexstem(const text_t &indexstem); 88 89 89 90 protected: 90 91 92 text_t indexstem; // the stem of the index files - defaults to the collectionname 91 93 void setsearchmode (const queryparamclass &queryparams); 92 94 void submitquery (const queryparamclass &queryparams); 93 95 void getresults (const queryparamclass &queryparams, queryresultsclass &queryresults); 94 96 text_t getindexsuffix (const text_t &collection, const text_t &index); 95 97 virtual void filterquery (text_t &ttquerystring); 96 98 }; -
trunk/gsdl/src/colservr/queryfilter.cpp
r9620 r9937 331 331 } else if (key == "defaultlanguage") { 332 332 languagemap.from2to (cfgline[0], filterOptions["Language"].defaultValue); 333 } else if (key == "indexstem") { 334 indexstem = cfgline[0]; 333 335 } 334 336 } … … 367 369 368 370 // get the filename for the database and make sure it exists 369 gdbm_filename = filename_cat(gdbmhome, "collect", collection, "index", "text", collection); 371 if (indexstem.empty()) { 372 indexstem = collection; 373 } 374 gdbm_filename = filename_cat(gdbmhome, "collect", collection, "index", "text", indexstem); 370 375 371 376 if (littleEndian()) gdbm_filename += ".ldb"; -
trunk/gsdl/src/colservr/queryfilter.h
r8024 r9937 49 49 50 50 text_t gdbm_filename; 51 text_t indexstem; 51 52 gdbmclass *gdbmptr; 52 53
Note:
See TracChangeset
for help on using the changeset viewer.