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 chandrakant k <ch...@gmail.com> on 2009/07/14 13:35:06 UTC

Terms with negative boost should not contribute to coord()

I am firing a query having terms- each associated with a boost factor. Some
of the terms are having negative boost also (for negative boost I am using
values between 0 and 1).
The behaviour is that a document which has got more number of term matches,
scores high, the coord() factor contributes to the scoring substantially.
This happens even when terms with negative boosts are matched.

I am trying to implement a behaviour where  the coord factor should only
consider the terms with positive boost.
How should I proceed?. I would like some pointers regarding from where
should I start.

I was just wondering whether this should be the default behaviour- that
terms with negative boost should not contribute to coord factor. 

Removing the terms with negative boost from the query gives good results
upto some extent; but for searches where terms with positive boost are
totally absent, no results are returned.

Thanks in advance

Chandrakant K.
-- 
View this message in context: http://www.nabble.com/Terms-with-negative-boost-should-not-contribute-to-coord%28%29-tp24477758p24477758.html
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


Re: Terms with negative boost should not contribute to coord()

Posted by Chris Hostetter <ho...@fucit.org>.
: I am firing a query having terms- each associated with a boost factor. Some
: of the terms are having negative boost also (for negative boost I am using
: values between 0 and 1).

except that a value between 0 and 1 isn't really a negative boost -- 
there's no such thing as a negative boost.  what you've got are just
boosts with values that happen to be lower then the default value (1.0f).

: I am trying to implement a behaviour where  the coord factor should only
: consider the terms with positive boost.
: How should I proceed?. I would like some pointers regarding from where
: should I start.

you could subclass BooleanQuery/BooleanScorer and change the scoreing 
function to only compute the coord on the clauses with boosts greater then 
one.  but a simpletr approach that would probably work just as well would 
be to break your query up into tqo seperate BooleanQueries - one with your
"negative" boosts and disableCoord=true, another with your "positive" 
boosts, disableCoord=false.  then put both of those in a new top level 
BooleanQuery with disableCoord=true.




-Hoss


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