Changeset 12262


Ignore:
Timestamp:
2006-07-20T11:16:20+12:00 (18 years ago)
Author:
mdewsnip
Message:

Now parses the query terms returned from Lucene into the Greenstone TermInfo structures.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/src/colservr/expat_resultset.cpp

    r9620 r12262  
    1515#include "text_t.h"
    1616#include "queryinfo.h"
     17#include "gsdlunicode.h"
    1718
    1819struct queryresultpack {
     
    4243  text_t element_name = (char*)name;
    4344
     45  if (element_name == "Term") {
     46    char* term_value_str = get_attribute(attributes, "value");
     47    char* term_frequency_str = get_attribute(attributes, "freq");
     48
     49    termfreqclass termfreqobj;
     50    termfreqobj.termstr = to_uni(term_value_str);
     51    termfreqobj.termfreq = atoi(term_frequency_str);
     52    queryresult_ptr->orgterms.push_back(termfreqobj);
     53  }
     54
    4455  if (element_name=="MatchingDocsInfo") {
    4556    char* num_match_docs_str = get_attribute(attributes,"num");
     
    5162    }
    5263    else {
    53             queryresult_ptr->docs_matched = 0;
     64      queryresult_ptr->docs_matched = 0;
    5465    }
    55 
    5666  }
    5767
Note: See TracChangeset for help on using the changeset viewer.