lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From testn <te...@doramail.com>
Subject Re: strange MultiFieldQueryParser error: java.lang.Integer
Date Fri, 03 Aug 2007 15:29:53 GMT

Boost must be Map<String, Float>

Luca123 wrote:
> 
> Hi all,
> I've always used the MultiFieldQueryParser class without problems but 
> now i'm experiencing a strange problem.
> This is my code:
> 
> Map<String, Integer> boost = new HashMap<String, Integer>();
> boost.put("field1",5);
> boost.put("field2",1);
> 
> Analyzer analyzer = new StandardAnalyzer(STOP_WORDS);
> String[] s_fields = new String[2];
> s_fields[0] = "field1";
> s_fields[1] = "field2";
> MultiFieldQueryParser mfParser = new 
> MultiFieldQueryParser(s_fields,analyzer,boost);
> 		
> try {
> 	query = mfParser.parse(query_string);
> } catch(Exception ex) {
> 	System.out.println(ex.getMessage());
> }	
> 
> If I use a query like:
> hi all
> I'm getting the error: java.lang.Integer
> (quite hard to understand!!)
> 
> If I use a query like:
> field1:hi field1:all field2:hi field2:all
> everything works correctly!!
> 
> What I'm missing?
> Thanks
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/strange-MultiFieldQueryParser-error%3A-java.lang.Integer-tf4212784.html#a11985571
Sent from the Lucene - Java Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message