lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erik Hatcher <>
Subject Re: Boosting a subquery
Date Thu, 29 Sep 2005 13:17:11 GMT

On Sep 29, 2005, at 5:42 AM, Anand Kishore wrote:

> Hi,
>  LIA has info about boosting terms and/or fields but how do I go about
> boosting an entire bracketed subquery. For example: if I have a query
> consisting of 2 subqueries like:
> (xyz:AAA OR qwe:BBB) OR (xyz:CCC OR zxc:DDD)
>  I want to boost subquery1 so that documents are ranked accordingly.

I presume you're asking how QueryParser syntax allows for this?    
Simply add ^2.0 (or whatever boost you'd like) after the expression:

     (erik OR otis)^2.0 lucene


You'll see the Query from the parse displayed (we use stemming, so  
"otis" get stemmed in this case, poor guy, as does "lucene").


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

View raw message