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 Diego Manilla Suárez <di...@xeridia.com> on 2007/04/25 14:23:43 UTC

Customizing scoring

We have an index with fields than can be multiple (i.e. a document has 
two fields called “pets” that contain “dog” and “cat”).

The problem comes when we calculate the score:

If a BooleanQuery is created as the addition of two TermQuery

TermQuery1 “pets:dog”

TermQuery2 “pets:cat”

BooleanQuery “(pets:dog pets:cat)” (boost = 3)

The score for this BooleanQuery is double (around 6) when the compared 
document has the field “pets” with these two values, but we want that 
the score is only 3, although there is more than one coincidence.

SUMMARY: we want that a BooleanQuery is scored like a whole Query.

Is there some way to do this?

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


Re: Customizing scoring

Posted by Chris Hostetter <ho...@fucit.org>.
: If a BooleanQuery is created as the addition of two TermQuery
	...
: The score for this BooleanQuery is double (around 6) when the compared
: document has the field ?pets? with these two values, but we want that
: the score is only 3, although there is more than one coincidence.
	...
: Is there some way to do this?

Yes, you'll want to take a look at the documentation on scoring and
Similarity...

http://lucene.apache.org/java/docs/scoring.html
http://lucene.apache.org/java/docs/api/org/apache/lucene/search/package-summary.html#changingSimilarity



-Hoss


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