Hi,
I created a custom similarity and factory which extends
DefaultSimilarity/-Factory to have

to achive this I my similarity overwrites idfExplain like this and also the
method for an array of terms.
    public Explanation idfExplain(CollectionStatistics collectionStats,
TermStatistics termStats) {
        final long df = lookUpDocumentFrequency(termStats);
        final long max = getDocumentCountForIDF();
        final float idf = idf(df, max);
        log.debug("term:" + termStats.term() + " idf(docFreq=" + df + ",
maxDocs=" + max + ") -> " + idf);
        return Explanation.match(idf, "idf(docFreq=" + df + ", maxDocs=" +
max + ")");
    }

I configured my similarity for one field in the schema.

Without my plugin the score just uses the fieldWeight.
But when my similarity is enabled scores are calculated with the
fieldWeight multiplied by a queryWeight.
And this is done for ALL FIELDS queried, not only the one with my
similarity.

Why does this happen and is there a possibility to get around this.
>From a solr point of view this is probably ok because the score is not
meant to be absolute.
But in our application a user may set a threshold which is used as a filter
query like {!frange l=0.31}query($q).

Any hints?

Cheers,
 Sascha

Reply via email to