Changeset 608 for trunk/gsdl


Ignore:
Timestamp:
1999-09-21T23:34:42+12:00 (25 years ago)
Author:
sjboddie
Message:

added Maxdocs queryfilter option which may be -1 for 'all'

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

Legend:

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

    r543 r608  
    2828/*
    2929   $Log$
     30   Revision 1.23  1999/09/21 11:34:42  sjboddie
     31   added Maxdocs queryfilter option which may be -1 for 'all'
     32
    3033   Revision 1.22  1999/09/07 23:08:51  rjmcnab
    3134   removed some compiler warnings
     
    309312  // check m argument
    310313  int arg_m = args.getintarg("m");
    311   if (arg_m < 0) {
    312     logout << "Warning: \"m\" argument less than 0 (" << arg_m << ")\n";
     314  if (arg_m < -1) {
     315    logout << "Warning: \"m\" argument less than -1 (" << arg_m << ")\n";
    313316    cgiarginfo *minfo = argsinfo.getarginfo ("m");
    314317    if (minfo != NULL) args["m"] = minfo->argdefault;
     
    579582  int maxdocs = args.getintarg("m");
    580583  int numdocs = response.numDocs;
     584  if (maxdocs == -1) maxdocs = response.numDocs;
    581585  isapprox isApprox = response.isApprox;
    582586
     
    595599  }
    596600
    597   //  if (isApprox == MoreThan && numdocs > maxdocs) numdocs = maxdocs;
    598   if (numdocs > maxdocs) {numdocs = maxdocs; isApprox = MoreThan;}
    599 
    600601  if (isApprox == Approximate) resline = "_textapprox_";
    601602  else if (isApprox == MoreThan) resline = "_textmorethan_";
  • trunk/gsdl/src/recpt/querytools.cpp

    r533 r608  
    2828/*
    2929   $Log$
     30   Revision 1.7  1999/09/21 11:32:42  sjboddie
     31   added Maxdocs queryfilter option which may be -1 for 'all'
     32
    3033   Revision 1.6  1999/09/07 04:56:58  sjboddie
    3134   added GPL notice
     
    146149    }
    147150  }
     151
     152  int arg_m = args.getintarg("m");
     153
     154  option.name = "Maxdocs";
     155  option.value = arg_m;
     156  request.filterOptions.push_back (option);
    148157 
    149158  option.name = "StartResults";
     
    152161
    153162  option.name = "EndResults";
    154   int arg_m = args.getintarg("m");
    155163  int endresults = args.getintarg("o") + (args.getintarg("r") - 1);
    156   if (endresults > arg_m) endresults = arg_m;
     164  if ((endresults > arg_m) && (arg_m != -1)) endresults = arg_m;
    157165  option.value = endresults;
    158166  request.filterOptions.push_back (option);
Note: See TracChangeset for help on using the changeset viewer.