lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "none none" <kor...@lycos.com>
Subject Re: Using Boost factor in queries
Date Fri, 19 Jul 2002 13:41:10 GMT
you can build a query for each clause:
Query q_name = QueryParser.parse("("+qry+")^5","field_name",analyzer);
....
then add all the clause to a BooleanQuery:

BooleanQuery main = new BooleanQuery();
main.add(q_name, true, false);

true mean required, false mean prohibited:this is an and condition.

bye.


--

On Thu, 18 Jul 2002 15:59:31  
 Olivier Amira wrote:
>Hi all,
>
>  I'm looking for a good compromise to add a boost factor in my queries. 
>I generate a multi-field querie with multiples terms and I want to set a 
>specific boost factor for each fields.
>ex:
>query = name:( john steve bob ) AND type:( client boss ) AND position:( 
>first last second )
>
>My objective is to set a boost factor for the name field and another one 
>for the position. But the following syntax is not valid:
>
>query = name:( john steve bob )^2 AND type:( client boss ) AND 
>position:( first last second )^0.5
>
>So, I see a solution (but not very elegant) by splitting all the terms 
>and add the same boost factor for each, like:
>
>query = (name:john^2 OR name:steve^2 OR name:bob^2) AND type.....
>
>But with this method, my query will be very long, and should be very 
>painfull to process for the search engine (at least, I think).
>
>Somebody have a better idea?
>
>Thanks.
>
>-- 
>-----  Olivier Amira  -----
>WEBMOTION, Ottawa - Canada
>olivier.amira@webmotion.com
>
>
>
>
>--
>To unsubscribe, e-mail:   <mailto:lucene-user-unsubscribe@jakarta.apache.org>
>For additional commands, e-mail: <mailto:lucene-user-help@jakarta.apache.org>
>
>


_____________________________________________________
Supercharge your e-mail with a 25MB Inbox, POP3 Access, No Ads
and NoTaglines --> LYCOS MAIL PLUS.
http://www.mail.lycos.com/brandPage.shtml?pageId=plus 

--
To unsubscribe, e-mail:   <mailto:lucene-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:lucene-user-help@jakarta.apache.org>


Mime
View raw message