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 23:38:24 GMT

On Oct 7, 2005, at 11:17 AM, Sameer Shisodia wrote:
> thnx Erik. Is returning a default constant the answer i'm looking  
> for ?

Perhaps.  Try returning 1.0f - experimentation is always warranted  
when playing with scoring tweaks.  Have a look at  
IndexSearcher.explain() to see why documents score they way they do  
to help out with this.  Luke makes this sort of thing easy to do.

     Erik


> btw, the book is kewl :)
> sameer
>
> On 10/7/05, Erik Hatcher <erik@ehatchersolutions.com> wrote:
>
>>
>>
>> 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
>>
>>
>>
>
>
> --
> Sameer Shisodia Bangalore
> (c) +91-98451-80207
> get.sameer@gmail.com
>


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