Ignore:
Timestamp:
2006-07-19T14:45:46+12:00 (18 years ago)
Author:
mdewsnip
Message:

GSDLHOME and GSDLOS environment variables need to be set for lucene_query.pl. Thanks to John Thompson and DL Consulting Ltd.

File:
1 edited

Legend:

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

    r11162 r12246  
    4444
    4545#include "expat_resultset.h"
    46 
    4746
    4847text_t lucenesearchclass::getindexsuffix(const queryparamclass &qp) {
     
    129128  cerr << "***** index name = " << indexname << endl;
    130129
    131   text_t cmd = "\""+filename_cat(getenv("GSDLHOME"), "bin", "script", "lucene_query.pl")+"\"";
     130  text_t cmd = "\"" + filename_cat(gsdlhome, "bin", "script", "lucene_query.pl") + "\"";
    132131  cmd += (text_t)" \""+indexname + (text_t)"\" \"" + escaped_utf8querystring + (text_t)"\"";
    133132  cerr << "Lucene command: " << cmd << endl;
     
    135134  text_t xml_text = "";
    136135
     136  // I don't want to do this, but I have to.
     137  text_t gsdlhome_env = "GSDLHOME=" + gsdlhome;
     138  putenv(gsdlhome_env.getcstr());
     139
    137140#ifdef __WIN32__
     141  putenv("GSDLOS=windows");
     142
    138143  //FILE *PIN = _popen(cmd.getcstr(), "r"); // didn't seem to work
    139144  cmd = (text_t)"perl -S "+cmd;
     
    154159  }
    155160#else
     161  putenv("GSDLOS=linux");
     162
    156163  FILE *PIN = popen(cmd.getcstr(), "r");
    157164
     
    169176
    170177#endif
     178
    171179  expat_resultset(xml_text,queryresult);
    172180 
     
    344352}
    345353
    346 
    347 
    348 
    349 
     354void lucenesearchclass::set_gsdlhome (const text_t &gh)
     355{
     356  gsdlhome = gh;
     357}
Note: See TracChangeset for help on using the changeset viewer.