Ignore:
Timestamp:
2006-08-01T11:33:37+12:00 (18 years ago)
Author:
mdewsnip
Message:

Now uses the t variable to control whether a "some" or "all" search is done with Lucene. Many thanks to John Thompson and DL Consulting Ltd.

File:
1 edited

Legend:

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

    r12276 r12364  
    8484}
    8585
    86 
    8786bool lucenesearchclass::search(const queryparamclass &queryparams,
    8887                   queryresultsclass &queryresult) {
     
    107106  }
    108107 
    109   // set default Boolean combiner from all/some setting
    110   // if match_mode == 1, ie all, default=1 ie AND
    111   // if match_mode == 0, ie some, default=0, ie OR
    112   int defaultBoolCombine = 0;
    113   if (queryparams.match_mode){
    114     defaultBoolCombine = 1;
    115   }
    116 
    117108  text_t utf8querystring = to_utf8(queryparams.querystring);
    118109  cerr << "**** query string = " << utf8querystring << endl;
     
    131122  cmd += (text_t)" \""+indexname + (text_t)"\" \"" + escaped_utf8querystring + (text_t)"\"";
    132123  if (!queryparams.sortfield.empty()) {
    133     cmd += " \"" + queryparams.sortfield + "\"";
    134   }
     124    cmd += " -sort \"" + queryparams.sortfield + "\"";
     125  }
     126
     127  // New code to support configuration of the default conjuction operator
     128  // set default Boolean combiner from all/some setting
     129  // if match_mode == 1, ie all, default=1 ie AND
     130  // if match_mode == 0, ie some, default=0, ie OR
     131  if (queryparams.match_mode)
     132    {
     133      cmd += " -dco AND";
     134    }
     135
    135136  cerr << "Lucene command: " << cmd << endl;
    136137 
Note: See TracChangeset for help on using the changeset viewer.