lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erik Hatcher <e...@ehatchersolutions.com>
Subject Re: Field length normalization
Date Fri, 07 Oct 2005 12:58:04 GMT

On Oct 7, 2005, at 4:14 AM, Sameer Shisodia wrote:

> Hi,
> Have started using Lucene recently so this might be a oft repeated
> qn (Do point me to archives if any).
> I'm storing multiple values of a field as a comma separated string
> during indexing.
> Obviously, some docs have more values and some only one and
> so hits against those with multiple values for the field suffer.
> Is there are trivial way of changing this without writing my own
> version Similarity() completely ?

Sure, you can subclass DefaultSimilarity and override and tweak just  
the lengthNorm() method.  Be sure to use IndexWriter.setSimilarity()  
to get your custom one used.

     Erik


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