lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robichaud, Jean-Philippe" <>
Subject RE: PerFieldSimilarity
Date Wed, 04 May 2005 20:07:16 GMT

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
( 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.


-----Original Message-----
From: Erik Hatcher [] 
Sent: Tuesday, May 03, 2005 7:40 PM
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.


To unsubscribe, e-mail:
For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message