lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ivan Brusic <>
Subject Re: Changing similarity at query time
Date Tue, 10 Dec 2013 01:30:53 GMT
To answer my own question, it appears that despite the warning, using a
custom similarity only at search time appears to be working. The score()
method was the wrong code to override, I simply hardcoded the return value
of decodeNormValue to 1.0. Since this value is used for normalization, as
long as I am consistent, it should be valid.

Now onto the real testing.



On Mon, Dec 9, 2013 at 9:41 AM, Ivan Brusic <> wrote:

> I am currently using document-level boosts, which really translates to
> changing the norm for every field under the covers. As part of an
> experiment, I want to remove the boost, but that would require either
> re-indexing content or changing the scoring algorithm (similarity).
> If I create my own similarity, which would be identical to the
> default/TFIDF similarity but with the norm hardcoded to 1.0. The Lucene
> source warns against such behavior. I am assuming this is because it
> appears computeNorm is only run at index time,but shouldn't I be able to
> override score() and ignore the decodeNormValue calculation?
> Cheers,
> Ivan

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