lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Robert Muir <>
Subject Re: Lucene nightly build: similarity score per field
Date Fri, 04 Mar 2011 19:39:50 GMT
On Fri, Mar 4, 2011 at 2:12 PM, Patrick Diviacco
<> wrote:
> hey Robert,
> I know there is the documentation, I'm sorry I've confused setSimilarity
> with setSimilarityProvider.
> However, my question was about "Similarity get(String field) method" (I
> cannot understand from documentation sorry).
> Should I create a customSimilarity class implementing the SimilarityProvider
> and then implement the get method ?
> Also, inside the get method should I check the passed string field and
> return different custom similarities classes ?

yes, the SimilarityProvider is a factory interface that returns a
Similarity for a specified field.

So you have to implement this interface, and in your get(String field)
method return the appropriate Similarity for the field.

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

View raw message