Changeset 12864


Ignore:
Timestamp:
2006-09-27T15:10:31+12:00 (18 years ago)
Author:
kjdon
Message:

set_stem_index_args sets ks, ss, and afs args depending on the value of colinfo stemIndexes. these indicate whether casefolding, stemming and accentfolding are supported in the index. Also added AccentFold option to filter options

Location:
trunk/gsdl/src/recpt
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/src/recpt/querytools.cpp

    r12792 r12864  
    9393}
    9494
     95// sets the ks, ss, afs (casesupport, stemsupport, accentfoldsupport) args
     96void set_stem_index_args(ColInfoResponse_t *cinfo, cgiargsclass &args) {
     97  int stemIndexes = cinfo->stemIndexes;
     98
     99  if (stemIndexes & SIcasefold) {
     100    args["ks"] = 1;
     101  }
     102  if (stemIndexes & SIstem) {
     103    args["ss"] = 1;
     104  }
     105  if (stemIndexes & SIaccentfold) {
     106    args["afs"] = 1;
     107  }
     108
     109}
     110
    95111// request.filterResultOptions and request.fields (if required) should
    96112// be set from the calling code
     
    128144  request.filterOptions.push_back (option);
    129145
     146  option.name = "AccentFold";
     147  option.value = (args.getintarg("af")) ? "true" : "false";
     148  request.filterOptions.push_back (option);
     149 
    130150  if (!args["h"].empty()) {
    131151    option.name = "Index";
     
    201221    option.name = "Stem";
    202222    option.value = (args.getintarg("s")) ? "true" : "false";
     223    request.filterOptions.push_back (option);
     224
     225    option.name = "AccentFold";
     226    option.value = (args.getintarg("af")) ? "true" : "false";
    203227    request.filterOptions.push_back (option);
    204228
  • trunk/gsdl/src/recpt/querytools.h

    r12783 r12864  
    3232
    3333void set_query_type_args(ColInfoResponse_t *cinfo, cgiargsclass &args);
     34void set_stem_index_args(ColInfoResponse_t *cinfo, cgiargsclass &args);
    3435
    3536void set_queryfilter_options (FilterRequest_t &request, const text_t &querystring,
Note: See TracChangeset for help on using the changeset viewer.