Ignore:
Timestamp:
2008-08-21T15:13:41+12:00 (16 years ago)
Author:
mdewsnip
Message:

Changed the Lucene code to use the Greenstone document OIDs directly, instead of creating its own numeric IDs and then mapping them to the Greenstone OIDs in the GDBM file. As well as being simpler and more space and speed efficient (the mapping no longer needs to be stored in the GDBM file, and no lookup needs to be done for each search result), this is another important step along the road to true incremental building.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • gsdl/trunk/runtime-src/src/colservr/queryinfo.cpp

    r12868 r16947  
    203203
    204204void docresultclass::clear () {
     205  docid="";
    205206  docnum=-1;
    206207  docweight=0.0;
     
    219220
    220221docresultclass &docresultclass::operator=(const docresultclass &d) {
     222  docid = d.docid;
    221223  docnum = d.docnum;
    222224  docweight = d.docweight;
     
    229231
    230232bool operator==(const docresultclass &x, const docresultclass &y) {
    231   return ((x.docnum == y.docnum) && (x.docweight == y.docweight) &&
     233  return ((x.docid == y.docid) && (x.docnum == y.docnum) && (x.docweight == y.docweight) &&
    232234      (x.num_query_terms_matched == y.num_query_terms_matched) &&
    233235      (x.num_phrase_match == y.num_phrase_match));
     
    235237
    236238bool operator<(const docresultclass &x, const docresultclass &y) {
    237   return ((x.docnum < y.docnum) ||
    238       ((x.docnum == y.docnum) &&
    239        ((x.docweight < y.docweight) ||
    240         ((x.docweight == y.docweight) &&
    241          ((x.num_query_terms_matched < y.num_query_terms_matched) ||
    242           ((x.num_query_terms_matched == y.num_query_terms_matched) &&
    243            ((x.num_phrase_match < y.num_phrase_match))))))));
     239  return ((x.docid < y.docid) ||
     240      ((x.docid == y.docid) &&
     241       ((x.docnum < y.docnum) ||
     242        ((x.docnum == y.docnum) &&
     243         ((x.docweight < y.docweight) ||
     244          ((x.docweight == y.docweight) &&
     245           ((x.num_query_terms_matched < y.num_query_terms_matched) ||
     246        ((x.num_query_terms_matched == y.num_query_terms_matched) &&
     247         ((x.num_phrase_match < y.num_phrase_match))))))))));
    244248}
    245249
Note: See TracChangeset for help on using the changeset viewer.