Return-Path: Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: (qmail 74441 invoked from network); 13 Sep 2006 18:07:46 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 13 Sep 2006 18:07:46 -0000 Received: (qmail 58323 invoked by uid 500); 13 Sep 2006 18:07:41 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 58051 invoked by uid 500); 13 Sep 2006 18:07:40 -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 58037 invoked by uid 99); 13 Sep 2006 18:07:40 -0000 Received: from idunn.apache.osuosl.org (HELO idunn.apache.osuosl.org) (140.211.166.84) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 13 Sep 2006 11:07:40 -0700 Authentication-Results: idunn.apache.osuosl.org smtp.mail=hossman_lucene@fucit.org; spf=permerror X-ASF-Spam-Status: No, hits=0.0 required=5.0 tests= Received-SPF: error (idunn.apache.osuosl.org: domain fucit.org from 169.229.70.167 cause and error) Received: from ([169.229.70.167:51833] helo=rescomp.berkeley.edu) by idunn.apache.osuosl.org (ecelerity 2.1 r(10620)) with ESMTP id 61/D2-10245-FA848054 for ; Wed, 13 Sep 2006 11:07:54 -0700 Received: by rescomp.berkeley.edu (Postfix, from userid 1007) id 1C41D5B772; Wed, 13 Sep 2006 11:06:20 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by rescomp.berkeley.edu (Postfix) with ESMTP id 17CB97F403 for ; Wed, 13 Sep 2006 11:06:20 -0700 (PDT) Date: Wed, 13 Sep 2006 11:06:20 -0700 (PDT) From: Chris Hostetter To: Lucene Users Subject: Re: SV: SV: Changing the Scoring api In-Reply-To: <8834A84C87A2C148AD46921BB8BFC97C0259C809@S1SE1MAIL.emea1.ad.group> Message-ID: References: <8834A84C87A2C148AD46921BB8BFC97C0259C809@S1SE1MAIL.emea1.ad.group> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=iso-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N 1) This is not java. Since it's not java, i can't even begin to guess what odd excentricities might exist in whatever lucene port you are using. 2) If this *were* java then it wouldn't work th way you want it to, since you have the tf function returning "1" regardless of the frequency ... this method needs to return "0" sometimes, otherwise *everything* is a match 3) based on #2, and the resulst you describe i'm guessing your similarity isn't being used at all -- check that, add a System.out.println("BOO") (or whatever the correlary is in this langauge) to all ofthese methods, = i don't think you'll ever see that output -- start with figuring out why your similarity is being used before you try to fix it any more. 4) once you are sure your Similarity is being used, then take a look at the IndexSearcher.explain methods --they are your best riend in tweaking scoring information. : Date: Wed, 13 Sep 2006 14:42:13 +0200 : From: Marcus Falck : Reply-To: java-user@lucene.apache.org : To: java-user@lucene.apache.org : Subject: SV: SV: Changing the Scoring api : : It didn't really work for booleanqueries either. I thought it was working= for some hours but to my big disappointment I realized that this was not t= he case. : : Im using two IndexReaders ( RAM and FS ) and one multireader. Creating on= e indexsearcher by passing the multireader as constructor argument. : : Set the similarity class to my own similarity class using the SetSimilari= ty method on the searcher. : : This is the source for the similarity class I'm using: : : public class BoostOnlySimilarity : Similarity : { : /// Implemented as 1/sqrt(numTerms). : public override float LengthNorm(System.String fieldName, int num= Terms) : { : return 1; : } : : /// Implemented as 1/sqrt(sumOfSquaredWeights). : public override float QueryNorm(float sumOfSquaredWeights) : { : // Deal with the multiple terms issue : return 1; : //return (float)(1.0 / sumOfSquaredWeights); // return 1; : } : : /// Implemented as sqrt(freq). : public override float Tf(float freq) : { : return 1; : } : : /// Implemented as 1 / (distance + 1). : public override float SloppyFreq(int distance) : { : return 1; : } : : public override float Idf(Lucene.Net.Index.Term term, Searcher se= archer) : { : return 1; : } : public override float Ldf(int docFreq, int numDocs) : { : return 1; : } : /// Implemented as overlap / maxOverlap. : public override float Coord(int overlap, int maxOverlap) : { : return 1; : } : : } : : : / : Marcus : : : -----Ursprungligt meddelande----- : Fr=E5n: Chris Hostetter [mailto:hossman_lucene@fucit.org] : Skickat: den 12 september 2006 17:20 : Till: java-user@lucene.apache.org : =C4mne: Re: SV: Changing the Scoring api : : : : However the BooleanQuery's disableCoord seems to make effect. : : But I still have the problem when I'm constructing queries with wildcar= ds. : : really? ... that's strange, WildcardQuery uses the disableCoord feature o= f : BooleanQuery. Do you have an example of what you mean? : : : already had implemented my own similarity class that has the coord fixe= d : : to 1. And it doesn't work as excepted. : : are you setting your Similarity as the default on your IndexSearcher prio= r : to executing your Queries? : : : -Hoss : : : --------------------------------------------------------------------- : To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org : For additional commands, e-mail: java-user-help@lucene.apache.org : : : : : --------------------------------------------------------------------- : To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org : For additional commands, e-mail: java-user-help@lucene.apache.org : -Hoss --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org For additional commands, e-mail: java-user-help@lucene.apache.org