Custom hit score

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Custom hit score

Fisheye
I want to have a simple hit score for every document where the query has been found. E.g. if the query word was found 3 times in a document, this doc should have 100% score, next document with 2 times should have 90% and so on...

Normal hit score used by Lucene seems to be strange so I only want to know how many times a query text appears in a document. With that information, then I can make my own simple ranking...

Does someone know how this works in Lucene?

thx

Simon Dietschi
Reply | Threaded
Open this post in threaded view
|

Re: Custom hit score

Chris Hostetter-3

: I want to have a simple hit score for every document where the query has been
: found. E.g. if the query word was found 3 times in a document, this doc
: should have 100% score, next document with 2 times should have 90% and so

you haven't defined the scoring mechanism you want to use very clearly,
especially in cases of multi clause queries, but you should start by
writing your own Similarity subclass that returns a constant value for
everything but the tf(float) function -- for that return the same value as
the input.

that should be a pretty good start towards the simplest scoring mechanism
possible for ranking documents by the number of times words match ...
beyond that you'll wnat to read more in depth about similarity and study
the the Explanation output from some sample queries to make sense of
what's goming on.



-Hoss


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]