lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Doug Cutting <cutt...@lucene.com>
Subject Re: custom scoring api questions
Date Tue, 31 Dec 2002 17:39:51 GMT
Shah, Vineel wrote:
> Here's what I'm trying to do:
> A query that looks for for "java unix windows" in the "keywords" field of an index.
> 
> If the document has "java unix", the score is .66..., regardless of any other factor.
I want 1.0 for all three, .33... for just one, and no hit for none.

This is easy to do with the Similarity API.  Just define all of the 
methods to return 1.0, except queryNorm(), which, for your purposes, 
should return the inverse of the value passed.

I've attached a demonstration that implements the scoring you desire.

Doug

Mime
View raw message