You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Anand Kishore <an...@gmail.com> on 2005/09/29 11:42:32 UTC
Boosting a subquery
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.
--
- Andy
Re: Boosting a subquery
Posted by Erik Hatcher <er...@ehatchersolutions.com>.
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