Created
December 7, 2013 18:43
-
-
Save FabianKoestring/7846845 to your computer and use it in GitHub Desktop.
Custom implementation of the solr DefaultSimilarity class. With this no internal solr score changes will happen.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.apache.lucene.search.similarities; | |
import org.apache.lucene.index.FieldInvertState; | |
import org.apache.lucene.search.similarities.DefaultSimilarity; | |
public class MyNewSimilarityClass extends DefaultSimilarity { | |
@Override | |
public float coord(int overlap, int maxOverlap) { | |
return 1.0f; | |
} | |
@Override | |
public float idf(long docFreq, long numDocs) { | |
return 1.0f; | |
} | |
@Override | |
public float lengthNorm(FieldInvertState arg0) { | |
return 1.0f; | |
} | |
@Override | |
public float tf(float freq) { | |
return 1.0f; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment