lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Doug Cutting <cutt...@apache.org>
Subject Re: PerFieldSimilarity
Date Wed, 04 May 2005 20:45:18 GMT
Robichaud, Jean-Philippe wrote:
> 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.

You can also specify a Similarity implementation per Query node in a 
complex query, e.g.:

BooleanQuery query = new BooleanQuery() {
   public Similarity getSimilarity(Searcher searcher) {
     return new DefaultSimilarity {
        ... override Similarity methods here ...
     };
   }
}

Doug

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message