Changeset 759 for trunk/gsdl/src/recpt/querytools.cpp
- Timestamp:
- 1999-11-02T10:56:12+13:00 (25 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/src/recpt/querytools.cpp
r608 r759 28 28 /* 29 29 $Log$ 30 Revision 1.8 1999/11/01 21:56:12 sjboddie 31 changes for cross-collection searching - still needs work 32 30 33 Revision 1.7 1999/09/21 11:32:42 sjboddie 31 34 added Maxdocs queryfilter option which may be -1 for 'all' … … 56 59 57 60 58 // do_query sets the filter options and makes the protocol call to 59 // do a query. The results are returned in response. 60 // request.filterResultOptions and request.fields (if required) 61 // should be set by the calling function. 62 63 bool do_query (FilterRequest_t &request, cgiargsclass &args, 64 recptproto *collectproto, FilterResponse_t &response, 65 ostream &logout) { 61 // request.filterResultOptions and request.fields (if required) should 62 // be set from the calling code 63 void set_queryfilter_options (FilterRequest_t &request, const text_t &querystring, 64 cgiargsclass &args) { 66 65 67 66 request.filterName = "QueryFilter"; 68 67 69 comerror_t err;70 68 OptionValue_t option; 71 text_t formattedstring = args["q"];72 format_querystring (formattedstring, args.getintarg("b"));73 69 74 70 option.name = "Term"; 75 option.value = formattedstring;71 option.value = querystring; 76 72 request.filterOptions.push_back (option); 77 73 … … 106 102 } 107 103 104 set_more_queryfilter_options (request, args); 105 } 106 107 void set_queryfilter_options (FilterRequest_t &request, const text_t &querystring1, 108 const text_t &querystring2, cgiargsclass &args) { 109 110 set_queryfilter_options (request, querystring1, args); 111 108 112 // fill in the second query if needed 109 113 if (!args["cq2"].empty()) { 114 OptionValue_t option; 115 110 116 option.name = "CombineQuery"; 111 117 option.value = args["cq2"]; 112 118 request.filterOptions.push_back (option); 113 119 114 text_t formattedstring2 = args["q2"];115 format_querystring (formattedstring2, args.getintarg("b"));116 117 120 option.name = "Term"; 118 option.value = formattedstring2;119 request.filterOptions.push_back (option); 120 121 option.value = querystring2; 122 request.filterOptions.push_back (option); 123 121 124 option.name = "QueryType"; 122 125 option.value = (args.getintarg("t")) ? "ranked" : "boolean"; … … 149 152 } 150 153 } 151 154 set_more_queryfilter_options (request, args); 155 } 156 157 void set_more_queryfilter_options (FilterRequest_t &request, cgiargsclass &args) { 158 159 OptionValue_t option; 152 160 int arg_m = args.getintarg("m"); 153 161 154 162 option.name = "Maxdocs"; 155 163 option.value = arg_m; 156 164 request.filterOptions.push_back (option); 157 165 158 option.name = "StartResults"; 159 option.value = args["r"]; 160 request.filterOptions.push_back (option); 161 162 option.name = "EndResults"; 163 int endresults = args.getintarg("o") + (args.getintarg("r") - 1); 164 if ((endresults > arg_m) && (arg_m != -1)) endresults = arg_m; 165 option.value = endresults; 166 request.filterOptions.push_back (option); 167 168 collectproto->filter (args["c"], request, response, err, logout); 169 170 if (err != noError) { 171 outconvertclass text_t2ascii; 172 logout << text_t2ascii 173 << "Error: call to QueryFilter failed in queryaction (" 174 << get_comerror_string (err) << ")\n"; 175 return false; 176 } 177 return true; 166 // option.name = "StartResults"; 167 // option.value = args["r"]; 168 // request.filterOptions.push_back (option); 169 170 // option.name = "EndResults"; 171 // int endresults = args.getintarg("o") + (args.getintarg("r") - 1); 172 // if ((endresults > arg_m) && (arg_m != -1)) endresults = arg_m; 173 // option.value = endresults; 174 // request.filterOptions.push_back (option); 178 175 } 179 176
Note:
See TracChangeset
for help on using the changeset viewer.