I think it is not possible, by only modifying Similarity, to make the total score only count for documents boosts (which is the original request in this discussion).
This is because a higher level scorer always sums the scores of "its" sub-scorers - is this right...? if so there are probably two options: - using Solr's FunctionQuery as suggested earlier in this thread, maintaining the desired score in a dedicated field rather than in doc boost - this is perhaps a better approach, because the doc boost was not intended for this use (it only resides in 1 byte together with other factors, etc.) - writing a dedicated (top level) scorer - and query, and weight - that would not sum on subscorers. Chris Hostetter <[EMAIL PROTECTED]> wrote on 13/09/2006 11:06:20: > > 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 I agree that tf='always 1' is weird on scoring computations, but since tf is checked only for documents that contain the processed term (walking termDocs), actually tf would never return 0. An idf='always 1' seems to me more harsh for the scoring process - if it is this way modified, it should be set a much smaller value. > 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 <[EMAIL PROTECTED]> > : 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 constructorargument. > : > : 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:[EMAIL PROTECTED] > : 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: [EMAIL PROTECTED] > : For additional commands, e-mail: [EMAIL PROTECTED] > : > : > : > : > : --------------------------------------------------------------------- > : To unsubscribe, e-mail: [EMAIL PROTECTED] > : For additional commands, e-mail: [EMAIL PROTECTED] > : > > > > -Hoss > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]