- Timestamp:
- 1999-12-06T10:22:33+13:00 (24 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/src/recpt/queryaction.cpp
r776 r800 28 28 /* 29 29 $Log$ 30 Revision 1.31 1999/12/05 21:22:33 sjboddie 31 tidied up cross-collection searching a bit 32 30 33 Revision 1.30 1999/11/08 20:26:37 sjboddie 31 34 added multiplevalue option to cgiarginfo … … 438 441 text_tarray phrases; 439 442 get_phrases (args["q"], phrases); 443 num_phrases = phrases.size(); 440 444 text_tarray::const_iterator phere = phrases.begin(); 441 445 text_tarray::const_iterator pend = phrases.end(); … … 661 665 // from extlinkaction for now - this will probably want to use 662 666 // a separate argument eventually) 663 if (args["ccp"] != 1 && args["el"] != "direct") {667 // if (args["ccp"] != 1 && args["el"] != "direct") { 664 668 // display the cross collection search page 665 output_ccp (args, protos, disp, outconvert, textout, logout);666 } else {669 // output_ccp (args, protos, disp, outconvert, textout, logout); 670 // } else { 667 671 // query the selected collections 672 673 text_t::const_iterator b = args["cc"].begin(); 674 text_t::const_iterator e = args["cc"].end(); 675 if (!args["cc"].empty() && (findchar (b, e, ',') != e)) 668 676 if (!search_multiple_collections (args, protos, browsers, disp, outconvert, 669 677 textout, logout)) return false; 670 }671 } else {672 // simply query the current collection 673 if (!search_single_collection (args, protos, browsers, disp, outconvert,674 textout, logout)) return false; 675 } 676 678 else return true; 679 } 680 681 // simply query the current collection 682 if (!search_single_collection (args, protos, browsers, disp, outconvert, 683 textout, logout)) return false; 684 677 685 return true; 678 686 } … … 713 721 text_t freqmsg = "_textfreqmsg1_"; 714 722 int numdocs = 0; 723 isapprox isApprox = Exact; 715 724 text_tset colnamedata; 716 725 colnamedata.insert ("collectionname"); … … 775 784 } 776 785 786 if (isApprox == Exact) 787 isApprox = response.isApprox; 788 else if (isApprox == MoreThan) 789 if (response.isApprox == Approximate) 790 isApprox = response.isApprox; 791 777 792 text_t collectionname = *col_here; 778 793 FilterResponse_t nresponse; … … 808 823 } 809 824 810 if (numdocs > 0) disp.setmacro ("freqmsg", "query", freqmsg); 811 else disp.setmacro("resultline", "query", "_textnodocs_"); 812 825 disp.setmacro ("freqmsg", "query", freqmsg); 826 827 text_t resline; 828 if (num_phrases > 0) isApprox = Exact; 829 if (isApprox == Approximate) resline = "_textapprox_"; 830 else if (isApprox == MoreThan) resline = "_textmorethan_"; 831 832 if (numdocs == 0) resline = "_textnodocs_"; 833 else if (numdocs == 1) resline += "_text1doc_"; 834 else resline += text_t(numdocs) + " _textlotsdocs_"; 835 disp.setmacro("resultline", "query", resline); 813 836 814 837 QueryResult_tset::iterator res_here = results.begin(); … … 982 1005 // if there were phrases (post-processing) we're not going to include 983 1006 // those documents that didn't match 984 if (num_phrases > 0) { 985 numdocs = 0; 986 isApprox = Exact; 987 ResultDocInfo_tarray::const_iterator this_doc = response.docInfo.begin(); 988 ResultDocInfo_tarray::const_iterator end_doc = response.docInfo.end(); 989 while (this_doc != end_doc) { 990 if ((*this_doc).num_phrase_match == num_phrases) numdocs ++; 991 else break; // we can bail here as matching docs are sorted to top 992 this_doc++; 993 } 994 } 1007 if (num_phrases > 0) isApprox = Exact; 995 1008 996 1009 if (isApprox == Approximate) resline = "_textapprox_";
Note:
See TracChangeset
for help on using the changeset viewer.