Re: Similarity coefficient for more exact matching

2012-05-10 Thread Ian Lea
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

RE: Similarity coefficient for more exact matching

2012-05-04 Thread Paul Hill
> [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

Re: Similarity coefficient for more exact matching

2012-04-27 Thread Ian Lea
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