Increase coordination factor in Solr request

I have a problem with the default Solr scoring algorithm that determines the scope of my collection. In my domain, documents containing all of the query terms or most of the query terms are significantly more important than documents containing only a few terms. I would like to increase the number of documents so that the more matches, the higher the rating. I know that solr already raises such documents by multiplying the estimate by the coordination coefficient. However, the coordinating factor is insignificant for me, and I want to raise it to a certain extent. I am also familiar with the syntax setting of ExtendedDismax Minimum-Should-Match, but this function does not solve my problem, because I do not want to exclude documents that do not meet sufficient conditions, I just want to "punish" them.

Is there a way to increase the value of the coordination factor? I also agree with other solutions that do not use the coordination factor if they solve the problem.

+3
source share
1 answer

The easiest way is to simply write your own resemblance. You can override the method with what you like, and its implementation is quite simple. Sort of:

public class MySimilarity extends DefaultSimilarity {
    @Override
    public float coord(int overlap, int maxOverlap) {
        return super.coord(overlap, maxOverlap)^2;
    }
}

You can implement your own similarity implementation in a schema :

<similarity class="this.is.MySimilarity"/>
+1
source

All Articles