Matching matching = getMatchingModel(rq);
if (logger.isDebugEnabled()){
logger.debug("weighting model: " + wmodel.getInfo());
}
MatchingQueryTerms mqt = rq.getMatchingQueryTerms();
mqt.setDefaultTermWeightingModel((WeightingModel)wmodel);
Query q = rq.getQuery();
/* now propagate fields into requirements, and apply boolean matching
for the decorated terms. */
ArrayList<Query> requirement_list = new ArrayList<Query>();
ArrayList<Query> field_list = new ArrayList<Query>();
q.getTermsOf(RequirementQuery.class, requirement_list, true);
q.getTermsOf(FieldQuery.class, field_list, true);
// System.out.println(requirement_list);
// System.out.println(field_list);
for (int i=0; i<field_list.size(); i++)
if (!requirement_list.contains(field_list.get(i)))
requirement_list.add(field_list.get(i));
// System.out.println(requirement_list);
// System.out.println(field_list);
/*if (logger.isDebugEnabled())
{
for (int i=0; i<requirement_list.size(); i++) {
if(logger.isDebugEnabled()){
logger.debug("requirement: " + ((RequiredTermModifier)requirement_list.get(i)).getName());
}
}
for (int i=0; i<field_list.size(); i++) {
if(logger.isDebugEnabled()){
logger.debug("field: " + ((TermInFieldModifier)field_list.get(i)).getName());
}
}
}*/
if (requirement_list.size()>0) {
mqt.addDocumentScoreModifier(new BooleanScoreModifier(requirement_list));
}
mqt.setQuery(q);
mqt.normaliseTermWeights();
try{
ResultSet outRs = matching.match(rq.getQueryID(), mqt);
//now crop the collectionresultset down to a query result set.
rq.setResultSet(outRs.getResultSet(0, outRs.getResultSize()));
} catch (IOException ioe) {