try{
Request rq = (Request)srq;
if ( (! rq.isEmpty()) || MATCH_EMPTY_QUERY )
{
//TODO some exception handling here for not found models
Model wmodel = getWeightingModel(rq);
/* craigm 05/09/2006: only set the parameter of the weighting model
* if it was explicitly set if c_set control is set to true. Otherwise
* allow the weighting model to assume it's default value.
* This changes previous behaviour. TODO: some consideration for
* non TREC applications */
if (rq.getControl("c_set").equals("true"))
{
wmodel.setParameter(Double.parseDouble(rq.getControl("c")));
}
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();