Return-Path: Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: (qmail 82617 invoked from network); 7 Aug 2006 12:04:12 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 7 Aug 2006 12:04:12 -0000 Received: (qmail 69669 invoked by uid 500); 7 Aug 2006 12:04:07 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 69215 invoked by uid 500); 7 Aug 2006 12:04:06 -0000 Mailing-List: contact java-user-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: java-user@lucene.apache.org Delivered-To: mailing list java-user@lucene.apache.org Received: (qmail 69204 invoked by uid 99); 7 Aug 2006 12:04:06 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 07 Aug 2006 05:04:06 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: neutral (asf.osuosl.org: local policy) Received: from [66.111.4.28] (HELO out4.smtp.messagingengine.com) (66.111.4.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 07 Aug 2006 05:04:05 -0700 Received: from frontend3.internal (frontend3.internal [10.202.2.152]) by frontend1.messagingengine.com (Postfix) with ESMTP id D64CCD940DB for ; Mon, 7 Aug 2006 08:03:43 -0400 (EDT) Received: from heartbeat1.messagingengine.com ([10.202.2.160]) by frontend3.internal (MEProxy); Mon, 07 Aug 2006 08:03:44 -0400 X-Sasl-enc: wKHxN8pv68ObeSWqgHI6nMc1niwtda0vQwi2d1UqYzOi 1154952223 Received: from [10.17.4.3] (pool-72-70-33-84.bstnma.fios.verizon.net [72.70.33.84]) by mail.messagingengine.com (Postfix) with ESMTP id DD75B3E26 for ; Mon, 7 Aug 2006 08:03:43 -0400 (EDT) Message-ID: <44D72C1C.2010607@mikemccandless.com> Date: Mon, 07 Aug 2006 08:03:40 -0400 From: Michael McCandless User-Agent: Thunderbird 2.0a1 (X11/20060724) MIME-Version: 1.0 To: java-user@lucene.apache.org Subject: Re: lengthNorm method of Similarity not beeing called References: <0ae901c6ba11$67750350$1e8e10ac@ecommerce.tspain.local> In-Reply-To: <0ae901c6ba11$67750350$1e8e10ac@ecommerce.tspain.local> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N > At this post Erik says: > > "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." > > Well, I traced my own method lengthNorm and realized that this method is not being called. The lengthNorm() method, I believe, is only called during indexing. Its purpose is to translate the number of terms that occurred in a given field, into a score factor that is used at query time. Can you verify that you called IndexWriter.setSimilarity() (as above) before adding documents to the index? And then see if your lengthNorm() is then being called? Mike --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org For additional commands, e-mail: java-user-help@lucene.apache.org