I tried this out and it works perfectly. I'm loving Lucene! Thanks Doug! -----Original Message----- From: Doug Cutting [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 31, 2002 12:40 PM To: Lucene Developers List Subject: Re: custom scoring api questions
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