Damn...I was obfuscated seeing the 14 there...I had naively thought that
term freq would not be stored in the doc, 1 would be stored, but I guess it
still stores the real value and then applies custom similarity at query
time.

That means changing to a custom similarity does not need reindexing right?

thanks for the help!
xavier


On Thu, Mar 21, 2013 at 5:26 PM, Chris Hostetter
<hossman_luc...@fucit.org>wrote:

> : > public class NoTfSimilarity extends DefaultSimilarity {
> : >         public float tf(float freq) {
> : >                 return freq > 0 ? 1.0f : 0.0f;
> : >         }
> : > }
>         ...
>
> : > But I still see tf=14 in my query??
>         ...
> : >             1.0 = tf(freq=14.0), with freq of:
> : >               14.0 = termFreq=14.0
>
> pretty sure you are looking at the explanation of the *input* to your tf()
> function, not that the *output* is 1.0, just like in your function.
>
> Did you compare this to what you see using the DefaultSimilarity?
>
>
>
> -Hoss
>

Reply via email to