lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "luqun lou" <>
Subject MultiFieldQueryParser Problems about how to give the fields weight
Date Wed, 11 May 2005 15:49:34 GMT
    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 
    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);
    	return bQuery;
is it right?

FREE pop-up blocking with the new MSN Toolbar - get it now!

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message