lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Hostetter <hossman_luc...@fucit.org>
Subject Re: SV: SV: Changing the Scoring api
Date Wed, 13 Sep 2006 18:06:20 GMT

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 <marcus.falck@observer.se>
: 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 the case.
:
: Im using two IndexReaders ( RAM and FS ) and one multireader. Creating one indexsearcher
by passing the multireader as constructor argument.
:
: Set the similarity class to my own similarity class using the SetSimilarity method on the
searcher.
:
: This is the source for the similarity class I'm using:
:
:     public class BoostOnlySimilarity : Similarity
:     {
:         /// <summary>Implemented as <code>1/sqrt(numTerms)</code>. </summary>
:         public override float LengthNorm(System.String fieldName, int numTerms)
:         {
:             return 1;
:         }
:
:         /// <summary>Implemented as <code>1/sqrt(sumOfSquaredWeights)</code>.
</summary>
:         public override float QueryNorm(float sumOfSquaredWeights)
:         {
:             // Deal with the multiple terms issue
:             return 1;
:             //return (float)(1.0 / sumOfSquaredWeights); // return 1;
:         }
:
:         /// <summary>Implemented as <code>sqrt(freq)</code>. </summary>
:         public override float Tf(float freq)
:         {
:             return 1;
:         }
:
:         /// <summary>Implemented as <code>1 / (distance + 1)</code>. </summary>
:         public override float SloppyFreq(int distance)
:         {
:             return 1;
:         }
:
:         public override float Idf(Lucene.Net.Index.Term term, Searcher searcher)
:         {
:             return 1;
:         }
:         public override float Ldf(int docFreq, int numDocs)
:         {
:             return 1;
:         }
:         /// <summary>Implemented as <code>overlap / maxOverlap</code>.
</summary>
:         public override float Coord(int overlap, int maxOverlap)
:         {
:             return 1;
:         }
:
:     }
:
:
: /
: Marcus
:
:
: -----Ursprungligt meddelande-----
: Från: Chris Hostetter [mailto:hossman_lucene@fucit.org]
: Skickat: den 12 september 2006 17:20
: Till: java-user@lucene.apache.org
: Ämne: 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 wildcards.
:
: really? ... that's strange, WildcardQuery uses the disableCoord feature of
: BooleanQuery.  Do you have an example of what you mean?
:
: : already had implemented my own similarity class that has the coord fixed
: : to 1. And it doesn't work as excepted.
:
: are you setting your Similarity as the default on your IndexSearcher prior
: 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


Mime
View raw message