lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chris Salem" <>
Subject custom scorer
Date Wed, 19 Aug 2009 20:20:07 GMT
I'm trying to write a custom scorer that only uses the term frequency function from the DefaultSimilarity
class, the problem is that documents with lower frequencies are returning with higher scores
than documents with higher frequencies.  Here's the code:
searcher.setSimilarity(new DefaultSimilarity(){
 public float lengthNorm(String field, int numTerms){
  return 1;        
 public float idf(int docFreq, int numDocs){
  return 1;
 public float coord(int overlap, int maxoverlap){
  return 1;
 public float queryNorm(float sumOfSquaredWeights){
  return 1;
 public float sloppyFreq(int distance){
  return 1;
Any idea why this wouldn't be working?
Chris Salem 

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message