Ignore:
Timestamp:
1999-08-11T10:46:33+12:00 (25 years ago)
Author:
sjboddie
Message:

changed format option result to QueryResults and added QueryLinks option

File:
1 edited

Legend:

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

    r421 r447  
    1212/*
    1313   $Log$
     14   Revision 1.18  1999/08/10 22:46:33  sjboddie
     15   changed format option result to QueryResults and added QueryLinks option
     16
    1417   Revision 1.17  1999/07/30 02:24:42  sjboddie
    1518   added collectinfo argument to some functions
     
    432435
    433436  if (formatstring.empty()) {
    434     text_tmap::const_iterator result = collectinfo.format.find("result");
     437    text_tmap::const_iterator result = collectinfo.format.find("QueryResults");
    435438    if (result != collectinfo.format.end())
    436439      formatstring = (*result).second;
     440  }
     441
     442  // see if there's a QueryLinks format option
     443  text_t querylinkmeta;
     444  bool havequerylink = false;
     445  text_tmap::const_iterator it = collectinfo.format.find("QueryLinks");
     446  if (it != collectinfo.format.end()) {
     447    querylinkmeta = (*it).second;
     448    havequerylink = true;
    437449  }
    438450
     
    453465
    454466    parse_formatstring (formatstring, formatlistptr, request.fields, request.getParents);
     467
     468    if (havequerylink)
     469      request.fields.push_back (querylinkmeta);
     470
     471    int metasize = request.fields.size();
    455472
    456473    // do the query
     
    475492      // those that did match will have been sorted to the top
    476493      if ((*this_doc).num_phrase_match < num_phrases) break;
    477       textout << outconvert << disp << "<tr>\n"
    478    
    479     //            << "<td valign=top nowrap>r: " << (*this_doc).ranking
    480     //            << " t: " << (*this_doc).num_terms_matched << " p: "
    481     //            << (*this_doc).num_phrase_match << "</td>\n"
    482    
    483           << get_formatted_string (*this_doc, formatlistptr) << "\n"
    484           << "</tr>\n";
     494      textout << "<tr>\n";
     495      if (havequerylink) {
     496    const text_t &qlmeta = (*this_doc).metadata[metasize-1].values.back();
     497    if (qlmeta.empty())
     498      textout << outconvert << disp
     499          << get_formatted_string (*this_doc, formatlistptr, "", "_icontext_") << "\n";
     500    else
     501      textout << outconvert << disp
     502          << get_formatted_string (*this_doc, formatlistptr) << "\n";
     503      } else {
     504    textout << outconvert << disp
     505        << get_formatted_string (*this_doc, formatlistptr) << "\n";
     506      }
     507      textout << "</tr>\n";
    485508
    486509      this_doc ++;
     
    537560  }
    538561
    539   if (isApprox == MoreThan && numdocs > maxdocs) numdocs = maxdocs;
     562  //  if (isApprox == MoreThan && numdocs > maxdocs) numdocs = maxdocs;
     563  if (numdocs > maxdocs) {numdocs = maxdocs; isApprox = MoreThan;}
    540564
    541565  if (isApprox == Approximate) resline = "_textapprox_";
Note: See TracChangeset for help on using the changeset viewer.