Re: Modifying Length Normalization calculation

2011-06-13 Thread Lahiru Samarakoon
Hi Ian, The order is right and your method is working for me. Thanks [?] Lahiru On Mon, Jun 13, 2011 at 7:15 PM, Ian Lea wrote: > This is getting beyond my level of expertise, but I'll have a go at > your questions. Hopefully someone better informed will step in with > corrections or confir

Re: Modifying Length Normalization calculation

2011-06-13 Thread Ian Lea
This is getting beyond my level of expertise, but I'll have a go at your questions. Hopefully someone better informed will step in with corrections or confirmation. > ... > The application calls the *writer.addDocument(d);* method and in this > process the *lengthNorm(String fieldName, int numTer

Re: Modifying Length Normalization calculation

2011-06-13 Thread Lahiru Samarakoon
HI Ian, Thank you very much for the reply. The application calls the *writer.addDocument(d);* method and in this process the *lengthNorm(String fieldName, int numTerms)* method is called. I can extend the *DefaultSimilarity* class and override the *lengthNorm*method, but how can I explicitly spe

Re: Modifying Length Normalization calculation

2011-06-13 Thread Ian Lea
org.apache.lucene.search.Similarity would be the place to look, specifically computeNorm(String field, FieldInvertState state). There is comprehensive info in the javadocs. Note that values are calculated at indexing and stored in the index encoded, with some loss of precision. -- Ian. On Mon,

Modifying Length Normalization calculation

2011-06-12 Thread Lahiru Samarakoon
Hi All, I want to change the length normalization calculation specific to my application. By changing the "*number of terms*" according to my requirement. The "*StandardTokenizer*" works perfectly for my application, However, the *number of terms* calculated by the tokenizer is not the effective n