Changeset 398 for trunk/gsdl/src/recpt


Ignore:
Timestamp:
1999-07-16T15:42:23+12:00 (25 years ago)
Author:
sjboddie
Message:

changed isApprox

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

Legend:

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

    r353 r398  
    1212/*
    1313   $Log$
     14   Revision 1.14  1999/07/16 03:41:29  sjboddie
     15   changed isApprox
     16
    1417   Revision 1.13  1999/07/08 20:46:45  rjmcnab
    1518   Added the result number to the ResultDocInfo_t
     
    202205void FilterResponse_t::clear () {
    203206  numDocs = 0;
    204   isApprox = false;
     207  isApprox = Exact;
    205208  termInfo.erase (termInfo.begin(), termInfo.end());
    206209  docInfo.erase (docInfo.begin(), docInfo.end());
  • trunk/gsdl/src/recpt/comtypes.h

    r353 r398  
    278278// FilterResponse ::= SEQUENCE {
    279279//   numDocs   [0] IMPLICIT INTEGER,
    280 //   isApprox  [1] IMPLICIT BOOLEAN,                  -- whether numDocs is approximate
    281 //   termInfo  [2] IMPLICIT SEQUENCE OF TermInfo,     -- empty if not required
    282 //   docInfo   [3] IMPLICIT SEQUENCE OF ResultDocInfo -- empty if not required
    283 // }
     280//   isApprox  [1] ENUMERATED {Exact(0), Approximate(1), MoreThan(2)}, -- whether numDocs is approximate
     281//   termInfo  [2] IMPLICIT SEQUENCE OF TermInfo,                      -- empty if not required
     282//   docInfo   [3] IMPLICIT SEQUENCE OF ResultDocInfo                  -- empty if not required
     283// }
     284
     285enum isapprox {Exact=0, Approximate=1, MoreThan=2};
     286
    284287struct FilterResponse_t {
    285288  void clear ();
     
    287290
    288291  int numDocs;
    289   bool isApprox; // some versions of mg might be more 'approximate' than others :-)
     292  isapprox isApprox;
    290293  TermInfo_tarray termInfo; // empty if not requested
    291294  ResultDocInfo_tarray docInfo; // empty if not requested
  • trunk/gsdl/src/recpt/queryaction.cpp

    r397 r398  
    1212/*
    1313   $Log$
     14   Revision 1.14  1999/07/16 03:41:29  sjboddie
     15   changed isApprox
     16
    1417   Revision 1.13  1999/07/16 00:19:01  sjboddie
    1518   some changes to the way quoted queries are handled
     
    512515  // set up _resultline_ macro
    513516  text_t resline;
    514 
    515   // can't use isApprox here as it will be false as long
    516   // as numDocs < MAXDOCS (currently 500). If arg_m is less
    517   // than MAXDOCS numDocs can be greater than arg_m while
    518   // isApprox is false.
    519   if (response.isApprox) resline = "_textapprox_";
     517  int maxdocs = args.getintarg("m");
     518
     519  if (response.isApprox == Approximate) resline = "_textapprox_";
     520  else if ((response.isApprox == MoreThan) || (response.numDocs > maxdocs))
     521    resline = "_textmorethan_";
    520522  if (numdocs == 0) resline = "_textnodocs_";
    521523  else if (numdocs == 1) resline += "_text1doc_";
    522   else resline += text_t(response.numDocs) + " _textlotsdocs_";
    523 
     524  else
     525    if (response.numDocs > maxdocs)
     526      resline += text_t(maxdocs) + " _textlotsdocs_";
     527    else
     528      resline += text_t(response.numDocs) + " _textlotsdocs_";
     529 
    524530  disp.setmacro("resultline", "query", resline);
    525531
Note: See TracChangeset for help on using the changeset viewer.