Changeset 4193


Ignore:
Timestamp:
2003-04-18T14:25:00+12:00 (21 years ago)
Author:
sjboddie
Message:

Added runtime support for the new maxnumeric build time option.

Location:
trunk/gsdl/src/colservr
Files:
5 edited

Legend:

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

    r3203 r4193  
    8585/////////////////////////////////
    8686
     87
     88void mgqueryfilterclass::configure (const text_t &key, const text_tarray &cfgline) {
     89  queryfilterclass::configure (key, cfgline);
     90
     91  if (key == "maxnumeric") {
     92    maxnumeric = cfgline[0].getint();
     93  }
     94}
     95
    8796// loads up phrases data structure with any phrases (that's the quoted bits)
    8897// occuring in the querystring
     
    272281
    273282  num_phrases = 0;
    274 
     283  maxnumeric = 4;
    275284}
    276285
     
    446455  while (query_here != query_end) {
    447456
     457    // set maxnumeric
     458    (*query_here).maxnumeric = maxnumeric;
     459
    448460    // if we're doing a phrase search we want to maximise hits by making it
    449461    // a boolean search on the index with the finest granularity - we'll
     
    483495      }
    484496    }
    485 
    486 #ifdef GSDL_BBC_COLLECTION
    487     // This is a special hack for the BBC collection's ProgNumber index
    488 
    489     // if we're searching the zzAB/zzAN index we want to remove all
    490     // non-alphanumeric characters from the query string
    491     text_t longindex; text_tarray splitindex;
    492     indexmap.to2from ((*query_here).index, longindex);
    493     splitchar (longindex.begin(), longindex.end(), ':', splitindex);
    494     text_t &indextype = splitindex[1];
    495     if (indextype == "zzabn") {
    496       text_t new_querystring;
    497       text_t::const_iterator here = (*query_here).querystring.begin();
    498       text_t::const_iterator end = (*query_here).querystring.end();
    499       while (here != end) {
    500         if ((*here >= 'a' && *here <= 'z') || (*here >= 'A' && *here <= 'Z') ||
    501             (*here >= '0' && *here <= '9')) {
    502           new_querystring.push_back (*here);
    503         }
    504         here ++;
    505       }
    506       (*query_here).querystring = new_querystring;
    507     }
    508 #endif
    509497    query_here ++;
    510498  }
  • trunk/gsdl/src/colservr/mgqueryfilter.h

    r1674 r4193  
    5151  int num_phrases;
    5252
     53  int maxnumeric;
     54
    5355  void get_phrase_terms (const text_t &querystring,
    5456             const termfreqclassarray &orgterms,
     
    7981  virtual ~mgqueryfilterclass ();
    8082
     83  virtual void configure (const text_t &key, const text_tarray &cfgline);
     84
    8185  void filter (const FilterRequest_t &request,
    8286           FilterResponse_t &response,
  • trunk/gsdl/src/colservr/mgsearch.cpp

    r2545 r4193  
    384384    mgq_ask(maxdocstr);
    385385  }
     386
     387  char maxnumericstr[32];
     388  sprintf(maxnumericstr, ".set maxnumeric %i", queryparams.maxnumeric);
     389  mgq_ask(maxnumericstr);
     390 
    386391}
    387392
  • trunk/gsdl/src/colservr/queryinfo.cpp

    r1319 r4193  
    4646  stemming = 0;
    4747  maxdocs = -1;    // all
     48  maxnumeric = 4;  // must default to the same value as mg_passes
    4849}
    4950
     
    6263  stemming = q.stemming;
    6364  maxdocs = q.maxdocs;
     65  maxnumeric = q.maxnumeric;
    6466
    6567  return *this;
     
    7981      (x.casefolding == y.casefolding) &&
    8082      (x.stemming == y.stemming) &&
    81       (x.maxdocs == y.maxdocs));
     83      (x.maxdocs == y.maxdocs) &&
     84      (x.maxnumeric == y.maxnumeric));
    8285}
    8386
     
    103106  outs << " stemming = \"" << q.stemming << "\"\n";
    104107  outs << " maxdocs = \"" << q.maxdocs << "\"\n";
     108  outs << " maxnumeric = \"" << q.maxnumeric << "\"\n";
    105109  outs << "\n";
    106110
  • trunk/gsdl/src/colservr/queryinfo.h

    r1319 r4193  
    6565  int stemming;
    6666  int maxdocs;
     67  int maxnumeric;
    6768
    6869  queryparamclass ();
Note: See TracChangeset for help on using the changeset viewer.