Ignore:
Timestamp:
2009-12-09T21:41:14+13:00 (14 years ago)
Author:
ak19
Message:

Changes to makefiles, configure files, and source code to work with the new configure flags that allow indexers to be individually compiled up by setting each indexer to be enabled or disabled (enable-mg, enable-mgpp, enable-lucene)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/runtime-src/src/colservr/collectset.cpp

    r19806 r21324  
    3636#include "sqlbrowsefilter.h"
    3737#include "queryfilter.h"
     38
     39#ifdef ENABLE_MG
    3840#include "mgqueryfilter.h"
     41#include "mgsource.h"
     42#endif
     43#ifdef ENABLE_MGPP
    3944#include "mgppqueryfilter.h"
    40 #include "mgsource.h"
     45#include "mgppsource.h"
     46#endif
     47#ifdef ENABLE_LUCENE
    4148#include "lucenequeryfilter.h"
    4249#include "lucenesource.h"
     50#endif
    4351
    4452#include <assert.h>
     
    6169  text_tarray collections;
    6270
     71#ifdef ENABLE_MG
    6372  mgsearch = NULL;
     73#endif
     74#ifdef ENABLE_MGPP
    6475  mgppsearch = NULL;
     76#endif
     77#ifdef ENABLE_LUCENE
    6578  lucenesearch = NULL;
     79#endif
    6680
    6781  // get gsdlhome (if we fail the error will be picked up later -- in
     
    100114  httpprefix = httpprefix_arg;
    101115
     116#ifdef ENABLE_MG
    102117  mgsearch = NULL;
     118#endif
     119#ifdef ENABLE_MGPP
    103120  mgppsearch = NULL;
     121#endif
     122#ifdef ENABLE_LUCENE
    104123  lucenesearch = NULL;
     124#endif
    105125
    106126}
     
    108128collectset::collectset ()
    109129{
     130#ifdef ENABLE_MG
    110131  mgsearch = NULL;
     132#endif
     133#ifdef ENABLE_MGPP
    111134  mgppsearch = NULL;
     135#endif
     136#ifdef ENABLE_LUCENE
    112137  lucenesearch = NULL;
     138#endif
    113139}
    114140
     
    310336
    311337    if (buildtype == "mg") {
     338#ifdef ENABLE_MG
    312339      mgsearch = new mgsearchclass();
    313340 
     
    323350      mgsource->set_textsearchptr (mgsearch);
    324351      cserver->add_source (mgsource);
     352#else
     353      cerr << "Error: buildtype " << buildtype << " not enabled." << endl;
     354#endif
    325355    }
    326356    else if (buildtype == "mgpp") {
     357#ifdef ENABLE_MGPP
    327358      mgppsearch = new mgppsearchclass();
    328359
     
    333364      cserver->add_filter (queryfilter);
    334365     
    335       // add a mg source
    336       mgsourceclass *mgsource = new mgsourceclass ();
    337       mgsource->set_db_ptr(db_ptr);
    338       mgsource->set_textsearchptr (mgppsearch);
    339       cserver->add_source (mgsource);
     366      // add a mgpp source
     367      mgppsourceclass *mgppsource = new mgppsourceclass ();
     368      mgppsource->set_db_ptr(db_ptr);
     369      mgppsource->set_textsearchptr (mgppsearch);
     370      cserver->add_source (mgppsource);
     371#else
     372      cerr << "Error: buildtype " << buildtype << " not enabled." << endl;
     373#endif
    340374    }
    341375    else if (buildtype == "lucene") {
     376#ifdef ENABLE_LUCENE
    342377      lucenesearch = new lucenesearchclass();
    343378      lucenesearch->set_gsdlhome(gsdlhome);
     
    354389      lucenesource->set_textsearchptr (lucenesearch);
    355390      cserver->add_source (lucenesource);
     391#else
     392      cerr << "Error: buildtype " << buildtype << " not enabled." << endl;
     393#endif
    356394    }
    357395    else {
    358       cerr << "Warning: unrecognized buildtype" << buildtype << endl;
     396      cerr << "Warning: unrecognized buildtype " << buildtype << endl;
    359397    }
    360398
     
    414452void collectset::remove_all_collections () {
    415453
     454#ifdef ENABLE_MG
    416455  // first unload any cached mg databases
    417456  if (mgsearch != NULL) {
    418457    mgsearch->unload_database();
    419458  }
     459#endif
    420460
    421461  // now delete the collection server objects
     
    512552  if (cservers.getcollectserver(collection) == NULL) return;
    513553
     554#ifdef ENABLE_MG
    514555  // first unload any cached mg databases - we may need to do something
    515556  // similar to this for mgpp and lucene too
     
    517558    mgsearch->unload_database();
    518559  }
     560#endif
    519561
    520562  // now delete the collection server object
Note: See TracChangeset for help on using the changeset viewer.