Now Suppose,There are two fields,"content","summary",but i think the query in content field may have highter weight than the summary field. how can i do it?
I overload the parse function,and add weights which store every fields weights.
public static Query parse(String query,String[] fields,float [] weights,Analyzer analyzer)
throws ParseException
{
BooleanQuery bQuery = new BooleanQuery();
for(int i=0;i<fields.length;i++){
Query q = parse(query,fields[i],analyzer);
q.setBoost(weights[i]);
bQuery.add(q,false,false);
}
return bQuery;
}
is it right?


_________________________________________________________________
FREE pop-up blocking with the new MSN Toolbar - get it now! http://toolbar.msn.click-url.com/go/onm00200415ave/direct/01/



--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to