lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erik Hatcher <e...@ehatchersolutions.com>
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

     <http://www.lucenebook.com/search?query=%28erik+OR+otis%29%5E2.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").

     Erik


---------------------------------------------------------------------
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