Changeset 613


Ignore:
Timestamp:
1999-09-22T00:01:07+12:00 (25 years ago)
Author:
sjboddie
Message:

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

File:
1 edited

Legend:

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

    r534 r613  
    2828/*
    2929   $Log$
     30   Revision 1.17  1999/09/21 12:01:07  sjboddie
     31   added Maxdocs queryfilter option (which may be -1 for 'all')
     32
    3033   Revision 1.16  1999/09/07 04:57:24  sjboddie
    3134   added gpl notice
     
    9093#include <assert.h>
    9194
    92 #define MAXDOCS 200 // note that maxdocs must be at least as large
    93                     // as the highest possible value of EndResults
    9495
    9596// some useful functions
     
    290291  query.casefolding = (filterOptions["Casefold"].defaultValue == "true");
    291292  query.stemming = (filterOptions["Stem"].defaultValue == "true");
    292   query.maxdocs = MAXDOCS; // default for single query
     293  query.maxdocs = filterOptions["Maxdocs"].defaultValue.getint();
    293294
    294295  OptionValue_tarray::const_iterator options_here = request.filterOptions.begin();
     
    319320      // "all", needed when combining queries where the document results are needed
    320321      if (need_matching_docs (request.filterResultOptions)) query.maxdocs = -1;
    321       else query.maxdocs = MAXDOCS; // "all"
     322      else query.maxdocs = filterOptions["Maxdocs"].defaultValue.getint();
    322323     
    323324    } else if ((*options_here).name == "StartResults") {
     
    342343    } else if ((*options_here).name == "Language") {
    343344      query.language = (*options_here).value;
     345    } else if ((*options_here).name == "Maxdocs") {
     346      query.maxdocs = (*options_here).value.getint();
    344347    } else {
    345348      logout << text_t2ascii
     
    503506  filtopt.validValues.push_back("some");
    504507  filtopt.validValues.push_back("all");
    505   filterOptions["QueryType"] = filtopt;
     508  filterOptions["MatchMode"] = filtopt;
    506509
    507510  // -- onePerTerm  Term           string ???
     
    556559  filtopt.defaultValue = "";
    557560  filterOptions["Language"] = filtopt;
     561
     562  // -- onePerQuery  Maxdocs  integer
     563  filtopt.clear();
     564  filtopt.name = "Maxdocs";
     565  filtopt.type = FilterOption_t::integert;
     566  filtopt.repeatable = FilterOption_t::onePerQuery;
     567  filtopt.defaultValue = "200";
     568  filtopt.validValues.push_back("-1");
     569  filtopt.validValues.push_back("1000");
     570  filterOptions["Maxdocs"] = filtopt;
    558571}
    559572
Note: See TracChangeset for help on using the changeset viewer.