I have an application where I use Lucene to retrieve "made up" documents, just like many people do. I my case, I need the score to be meaningful, really meaning full. For certain fields, the similarity should be a frequency count, without idf factor, for others the idf should be the real idf, for others again idf should be equal to sqrt(idf). Again, I can change the similarity of the reader at run-time and issue specific queries, summing the score myself, but that is pretty inefficient. A ScoreObject (http://mail-archives.apache.org/mod_mbox/lucene-java-user/200504.mbox/%3c42 [EMAIL PROTECTED]) would save me a little bit, but that's another topic.
I understand that Lucene objective is more to be a generic search engine rather than a semantic/special IR system, but it is so close of being so that is it too tempting to use it as is. Jp -----Original Message----- From: Erik Hatcher [mailto:[EMAIL PROTECTED] Sent: Tuesday, May 03, 2005 7:40 PM To: java-user@lucene.apache.org Subject: Re: PerFieldSimilarity On May 3, 2005, at 5:57 PM, Robichaud, Jean-Philippe wrote: > Hi Everyone, > > I've been searching the archive without success to answer this one: > is it > possible to specify one similarity class per field, just like we > can do with > an analyzer ? I know I can change the similarity of the searcher, > but that > restrict me to break some complex queries into different chunk and > sum the > score "by hand" rather than having the fast internal implementation > do the > job. What I would really like is to have something like > PerFieldAnalyzerWrapper but for similarity... Is this possible ? I'm interested in what your use case is in desiring this. What factors would you vary per field? The only factor that seems to make sense is lengthNorm which is computed at indexing time and does allow per-field tweaking. A custom Similarity subclass could be used to affect the lengthNorm based on the field name parameter. Erik --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]