Changeset 2646 for trunk


Ignore:
Timestamp:
2001-07-12T14:48:18+12:00 (23 years ago)
Author:
jrm21
Message:

fixed a bug where z3950 collections would die when retrieving a document -
we now pass all required information to the filter() - ie queryterm,
type (boolean|ranked) and field (title|author|any).

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

Legend:

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

    r2422 r2646  
    582582    comerror_t err;
    583583    OptionValue_tarray options;
    584     // we need to know what the query was for the z3950proto
     584    // we need to do the query again for the z3950proto
    585585    if (collectproto->get_protocol_name(err)=="z3950proto") {
    586586      OptionValue_t opt;
    587       opt.name="Query";
    588       opt.value=args["q"];
     587      opt.name="Term";opt.value=args["q"];options.push_back(opt);
     588      opt.name="QueryType";
     589      opt.value=(args.getintarg("t")) ? "ranked" : "boolean";
    589590      options.push_back(opt);
     591      opt.name="Index";opt.value=args["h"];options.push_back(opt);
    590592    }
    591593   
     
    757759     
    758760    // output the table of contents
    759     logout << "formatinfo.RelatedDocs: " << formatinfo.RelatedDocuments.getcstr() << endl;
    760761    output_toc (args, browsers, formatinfo, collectproto,
    761762        disp, outconvert, textout, logout);
  • trunk/gsdl/src/recpt/z3950proto.cpp

    r1900 r2646  
    343343      `EndResults'=`20'
    344344      `Term'=`firstword secondword' (term is just whatever the user typed in)
    345       `QueryType'=`ranked' => 'OR' (cgiarg t=1)
    346       `QueryType' = `boolean' => 'AND' (cgiarg t=0)
     345      `QueryType'=ranked|boolean   -> OR|AND
     346      //`MatchMode'=`some' => 'OR'
     347      //`MatchMode' = `all' => 'AND'
    347348      `Casefold'=`true'
    348349      `Stem'=`false'
     
    490491        OptionValue_tarray::iterator opt_end=request.filterOptions.end();
    491492        while (opthere!=opt_end) {
    492           if (opthere->name=="Query") {
     493          if (opthere->name=="Term") {
    493494        query=opthere->value;
    494         break;
     495          } else if (opthere->name=="Index") {
     496        field=opthere->value;
     497          } else if (opthere->name=="QueryType") {
     498        if (opthere->value=="ranked") querytype=1;
     499        else if (opthere->value=="boolean") querytype=2;
     500        else { /* error - shouldn't happen */
     501          /* currently unhandled */
     502        }
    495503          }
    496504          opthere++;
Note: See TracChangeset for help on using the changeset viewer.