Similarity.setDefault(new MySimilarity()) is certainly better than the
2 calls I recommended. Thanks.
I find it hard to see why one might not want to do this in normal
usage but have a vague recollection of someone once outlining some
obscure scenarios where different similarities at index and se
> [use] IndexWriterConfig.setSimilarity() and
> IndexSearcher.setSimilarity(), unless you are clever or like being confused.
>
> SweetSpotSimilarity might also be worth a look.
>
> --
> Ian.
Being even less clever, I just make sure I set:
Similarity.setDefault(new MySimilarity())
when crawl
You can override org.apache.lucene.search.Similarity/DefaultSimilarity
to tweak quite a lot of stuff.
computeNorm() may be the method you are interested in. Called at
indexing time so be sure to use the same implementation at index and
query time, using IndexWriterConfig.setSimilarity() and
Index