| Index: lucene/core/src/test/org/apache/lucene/search/TestCachingCollector.java |
| =================================================================== |
| --- lucene/core/src/test/org/apache/lucene/search/TestCachingCollector.java (revision 1403658) |
| +++ lucene/core/src/test/org/apache/lucene/search/TestCachingCollector.java (working copy) |
| @@ -36,7 +36,7 @@ |
| public float score() throws IOException { return 0; } |
| |
| @Override |
| - public float freq() throws IOException { return 0; } |
| + public int freq() throws IOException { return 0; } |
| |
| @Override |
| public int docID() { return 0; } |
| Index: lucene/core/src/test/org/apache/lucene/search/TestBooleanScorer.java |
| =================================================================== |
| --- lucene/core/src/test/org/apache/lucene/search/TestBooleanScorer.java (revision 1403658) |
| +++ lucene/core/src/test/org/apache/lucene/search/TestBooleanScorer.java (working copy) |
| @@ -81,7 +81,7 @@ |
| Scorer[] scorers = new Scorer[] {new Scorer(weight) { |
| private int doc = -1; |
| @Override public float score() { return 0; } |
| - @Override public float freq() { return 0; } |
| + @Override public int freq() { return 0; } |
| @Override public int docID() { return doc; } |
| |
| @Override public int nextDoc() { |
| Index: lucene/core/src/test/org/apache/lucene/search/TestPositiveScoresOnlyCollector.java |
| =================================================================== |
| --- lucene/core/src/test/org/apache/lucene/search/TestPositiveScoresOnlyCollector.java (revision 1403658) |
| +++ lucene/core/src/test/org/apache/lucene/search/TestPositiveScoresOnlyCollector.java (working copy) |
| @@ -36,7 +36,7 @@ |
| return idx == scores.length ? Float.NaN : scores[idx]; |
| } |
| |
| - @Override public float freq() { |
| + @Override public int freq() { |
| return 1; |
| } |
| |
| Index: lucene/core/src/test/org/apache/lucene/search/TestScoreCachingWrappingScorer.java |
| =================================================================== |
| --- lucene/core/src/test/org/apache/lucene/search/TestScoreCachingWrappingScorer.java (revision 1403658) |
| +++ lucene/core/src/test/org/apache/lucene/search/TestScoreCachingWrappingScorer.java (working copy) |
| @@ -44,7 +44,7 @@ |
| return idx == scores.length ? Float.NaN : scores[idx++]; |
| } |
| |
| - @Override public float freq() throws IOException { |
| + @Override public int freq() throws IOException { |
| return 1; |
| } |
| |
| Index: lucene/core/src/test/org/apache/lucene/search/JustCompileSearch.java |
| =================================================================== |
| --- lucene/core/src/test/org/apache/lucene/search/JustCompileSearch.java (revision 1403658) |
| +++ lucene/core/src/test/org/apache/lucene/search/JustCompileSearch.java (working copy) |
| @@ -17,6 +17,8 @@ |
| * limitations under the License. |
| */ |
| |
| +import java.io.IOException; |
| + |
| import org.apache.lucene.index.AtomicReaderContext; |
| import org.apache.lucene.index.Norm; |
| import org.apache.lucene.search.similarities.Similarity; |
| @@ -198,6 +200,11 @@ |
| protected float phraseFreq() { |
| throw new UnsupportedOperationException(UNSUPPORTED_MSG); |
| } |
| + |
| + @Override |
| + public int freq() throws IOException { |
| + throw new UnsupportedOperationException(UNSUPPORTED_MSG); |
| + } |
| |
| } |
| |
| @@ -227,7 +234,7 @@ |
| } |
| |
| @Override |
| - public float freq() { |
| + public int freq() { |
| throw new UnsupportedOperationException(UNSUPPORTED_MSG); |
| } |
| |
| Index: lucene/core/src/java/org/apache/lucene/search/MultiPhraseQuery.java |
| =================================================================== |
| --- lucene/core/src/java/org/apache/lucene/search/MultiPhraseQuery.java (revision 1403658) |
| +++ lucene/core/src/java/org/apache/lucene/search/MultiPhraseQuery.java (working copy) |
| @@ -261,7 +261,7 @@ |
| if (scorer != null) { |
| int newDoc = scorer.advance(doc); |
| if (newDoc == doc) { |
| - float freq = scorer.freq(); |
| + float freq = slop == 0 ? scorer.freq() : ((SloppyPhraseScorer)scorer).freq; |
| SloppySimScorer docScorer = similarity.sloppySimScorer(stats, context); |
| ComplexExplanation result = new ComplexExplanation(); |
| result.setDescription("weight("+getQuery()+" in "+doc+") [" + similarity.getClass().getSimpleName() + "], result of:"); |
| Index: lucene/core/src/java/org/apache/lucene/search/FilteredQuery.java |
| =================================================================== |
| --- lucene/core/src/java/org/apache/lucene/search/FilteredQuery.java (revision 1403658) |
| +++ lucene/core/src/java/org/apache/lucene/search/FilteredQuery.java (working copy) |
| @@ -204,7 +204,7 @@ |
| } |
| |
| @Override |
| - public float freq() throws IOException { return scorer.freq(); } |
| + public int freq() throws IOException { return scorer.freq(); } |
| |
| @Override |
| public Collection<ChildScorer> getChildren() { |
| @@ -298,7 +298,7 @@ |
| } |
| |
| @Override |
| - public final float freq() throws IOException { return scorer.freq(); } |
| + public final int freq() throws IOException { return scorer.freq(); } |
| |
| @Override |
| public final Collection<ChildScorer> getChildren() { |
| Index: lucene/core/src/java/org/apache/lucene/search/ConjunctionTermScorer.java |
| =================================================================== |
| --- lucene/core/src/java/org/apache/lucene/search/ConjunctionTermScorer.java (revision 1403658) |
| +++ lucene/core/src/java/org/apache/lucene/search/ConjunctionTermScorer.java (working copy) |
| @@ -99,7 +99,7 @@ |
| } |
| |
| @Override |
| - public float freq() { |
| + public int freq() { |
| return docsAndFreqs.length; |
| } |
| |
| Index: lucene/core/src/java/org/apache/lucene/search/PhraseScorer.java |
| =================================================================== |
| --- lucene/core/src/java/org/apache/lucene/search/PhraseScorer.java (revision 1403658) |
| +++ lucene/core/src/java/org/apache/lucene/search/PhraseScorer.java (working copy) |
| @@ -34,7 +34,7 @@ |
| abstract class PhraseScorer extends Scorer { |
| PhrasePositions min, max; |
| |
| - private float freq; //phrase frequency in current doc as computed by phraseFreq(). |
| + protected float freq; //phrase frequency in current doc as computed by phraseFreq(). |
| |
| final Similarity.SloppySimScorer docScorer; |
| |
| @@ -111,14 +111,6 @@ |
| } |
| |
| /** |
| - * phrase frequency in current doc as computed by phraseFreq(). |
| - */ |
| - @Override |
| - public final float freq() { |
| - return freq; |
| - } |
| - |
| - /** |
| * For a document containing all the phrase query terms, compute the |
| * frequency of the phrase in that document. |
| * A non zero frequency means a match. |
| Index: lucene/core/src/java/org/apache/lucene/search/PhraseQuery.java |
| =================================================================== |
| --- lucene/core/src/java/org/apache/lucene/search/PhraseQuery.java (revision 1403658) |
| +++ lucene/core/src/java/org/apache/lucene/search/PhraseQuery.java (working copy) |
| @@ -303,7 +303,7 @@ |
| if (scorer != null) { |
| int newDoc = scorer.advance(doc); |
| if (newDoc == doc) { |
| - float freq = scorer.freq(); |
| + float freq = slop == 0 ? scorer.freq() : ((PhraseScorer)scorer).freq; |
| SloppySimScorer docScorer = similarity.sloppySimScorer(stats, context); |
| ComplexExplanation result = new ComplexExplanation(); |
| result.setDescription("weight("+getQuery()+" in "+doc+") [" + similarity.getClass().getSimpleName() + "], result of:"); |
| Index: lucene/core/src/java/org/apache/lucene/search/ReqOptSumScorer.java |
| =================================================================== |
| --- lucene/core/src/java/org/apache/lucene/search/ReqOptSumScorer.java (revision 1403658) |
| +++ lucene/core/src/java/org/apache/lucene/search/ReqOptSumScorer.java (working copy) |
| @@ -86,7 +86,7 @@ |
| } |
| |
| @Override |
| - public float freq() throws IOException { |
| + public int freq() throws IOException { |
| // we might have deferred advance() |
| score(); |
| return (optScorer != null && optScorer.docID() == reqScorer.docID()) ? 2 : 1; |
| Index: lucene/core/src/java/org/apache/lucene/search/DisjunctionSumScorer.java |
| =================================================================== |
| --- lucene/core/src/java/org/apache/lucene/search/DisjunctionSumScorer.java (revision 1403658) |
| +++ lucene/core/src/java/org/apache/lucene/search/DisjunctionSumScorer.java (working copy) |
| @@ -130,7 +130,7 @@ |
| } |
| |
| @Override |
| - public float freq() throws IOException { |
| + public int freq() throws IOException { |
| return nrMatchers; |
| } |
| |
| Index: lucene/core/src/java/org/apache/lucene/search/BooleanScorer.java |
| =================================================================== |
| --- lucene/core/src/java/org/apache/lucene/search/BooleanScorer.java (revision 1403658) |
| +++ lucene/core/src/java/org/apache/lucene/search/BooleanScorer.java (working copy) |
| @@ -127,7 +127,7 @@ |
| public int docID() { return doc; } |
| |
| @Override |
| - public float freq() { return freq; } |
| + public int freq() { return freq; } |
| |
| @Override |
| public int nextDoc() { return NO_MORE_DOCS; } |
| @@ -322,7 +322,7 @@ |
| } |
| |
| @Override |
| - public float freq() throws IOException { |
| + public int freq() throws IOException { |
| throw new UnsupportedOperationException(); |
| } |
| |
| Index: lucene/core/src/java/org/apache/lucene/search/Scorer.java |
| =================================================================== |
| --- lucene/core/src/java/org/apache/lucene/search/Scorer.java (revision 1403658) |
| +++ lucene/core/src/java/org/apache/lucene/search/Scorer.java (working copy) |
| @@ -21,6 +21,8 @@ |
| import java.util.Collection; |
| import java.util.Collections; |
| |
| +import org.apache.lucene.index.DocsEnum; |
| + |
| /** |
| * Expert: Common scoring functionality for different types of queries. |
| * |
| @@ -39,7 +41,7 @@ |
| * TopScoreDocCollector}) will not properly collect hits |
| * with these scores. |
| */ |
| -public abstract class Scorer extends DocIdSetIterator { |
| +public abstract class Scorer extends DocsEnum { |
| /** the Scorer's parent Weight. in some cases this may be null */ |
| // TODO can we clean this up? |
| protected final Weight weight; |
| @@ -95,12 +97,9 @@ |
| public abstract float score() throws IOException; |
| |
| /** Returns number of matches for the current document. |
| - * This returns a float (not int) because |
| - * SloppyPhraseScorer discounts its freq according to how |
| - * "sloppy" the match was. |
| * |
| * @lucene.experimental */ |
| - public abstract float freq() throws IOException; |
| + public abstract int freq() throws IOException; |
| |
| /** returns parent Weight |
| * @lucene.experimental |
| Index: lucene/core/src/java/org/apache/lucene/search/ScoreCachingWrappingScorer.java |
| =================================================================== |
| --- lucene/core/src/java/org/apache/lucene/search/ScoreCachingWrappingScorer.java (revision 1403658) |
| +++ lucene/core/src/java/org/apache/lucene/search/ScoreCachingWrappingScorer.java (working copy) |
| @@ -61,7 +61,7 @@ |
| } |
| |
| @Override |
| - public float freq() throws IOException { |
| + public int freq() throws IOException { |
| return scorer.freq(); |
| } |
| |
| Index: lucene/core/src/java/org/apache/lucene/search/IndexSearcher.java |
| =================================================================== |
| --- lucene/core/src/java/org/apache/lucene/search/IndexSearcher.java (revision 1403658) |
| +++ lucene/core/src/java/org/apache/lucene/search/IndexSearcher.java (working copy) |
| @@ -758,7 +758,7 @@ |
| } |
| |
| @Override |
| - public float freq() { |
| + public int freq() { |
| throw new UnsupportedOperationException(); |
| } |
| |
| Index: lucene/core/src/java/org/apache/lucene/search/BooleanScorer2.java |
| =================================================================== |
| --- lucene/core/src/java/org/apache/lucene/search/BooleanScorer2.java (revision 1403658) |
| +++ lucene/core/src/java/org/apache/lucene/search/BooleanScorer2.java (working copy) |
| @@ -129,7 +129,7 @@ |
| } |
| |
| @Override |
| - public float freq() throws IOException { |
| + public int freq() throws IOException { |
| return 1; |
| } |
| |
| @@ -313,7 +313,7 @@ |
| } |
| |
| @Override |
| - public float freq() throws IOException { |
| + public int freq() throws IOException { |
| return countingSumScorer.freq(); |
| } |
| |
| Index: lucene/core/src/java/org/apache/lucene/search/MatchAllDocsQuery.java |
| =================================================================== |
| --- lucene/core/src/java/org/apache/lucene/search/MatchAllDocsQuery.java (revision 1403658) |
| +++ lucene/core/src/java/org/apache/lucene/search/MatchAllDocsQuery.java (working copy) |
| @@ -68,7 +68,7 @@ |
| } |
| |
| @Override |
| - public float freq() { |
| + public int freq() { |
| return 1; |
| } |
| |
| Index: lucene/core/src/java/org/apache/lucene/search/payloads/PayloadTermQuery.java |
| =================================================================== |
| --- lucene/core/src/java/org/apache/lucene/search/payloads/PayloadTermQuery.java (revision 1403658) |
| +++ lucene/core/src/java/org/apache/lucene/search/payloads/PayloadTermQuery.java (working copy) |
| @@ -103,12 +103,14 @@ |
| } |
| doc = spans.doc(); |
| freq = 0.0f; |
| + numMatches = 0; |
| payloadScore = 0; |
| payloadsSeen = 0; |
| while (more && doc == spans.doc()) { |
| int matchLength = spans.end() - spans.start(); |
| |
| freq += docScorer.computeSlopFactor(matchLength); |
| + numMatches++; |
| processPayload(similarity); |
| |
| more = spans.next();// this moves positions to the next match in this |
| @@ -179,7 +181,7 @@ |
| if (scorer != null) { |
| int newDoc = scorer.advance(doc); |
| if (newDoc == doc) { |
| - float freq = scorer.freq(); |
| + float freq = scorer.sloppyFreq(); |
| SloppySimScorer docScorer = similarity.sloppySimScorer(stats, context); |
| Explanation expl = new Explanation(); |
| expl.setDescription("weight("+getQuery()+" in "+doc+") [" + similarity.getClass().getSimpleName() + "], result of:"); |
| Index: lucene/core/src/java/org/apache/lucene/search/ConjunctionScorer.java |
| =================================================================== |
| --- lucene/core/src/java/org/apache/lucene/search/ConjunctionScorer.java (revision 1403658) |
| +++ lucene/core/src/java/org/apache/lucene/search/ConjunctionScorer.java (working copy) |
| @@ -138,7 +138,7 @@ |
| } |
| |
| @Override |
| - public float freq() throws IOException { |
| + public int freq() throws IOException { |
| return scorers.length; |
| } |
| |
| Index: lucene/core/src/java/org/apache/lucene/search/DisjunctionMaxScorer.java |
| =================================================================== |
| --- lucene/core/src/java/org/apache/lucene/search/DisjunctionMaxScorer.java (revision 1403658) |
| +++ lucene/core/src/java/org/apache/lucene/search/DisjunctionMaxScorer.java (working copy) |
| @@ -100,7 +100,7 @@ |
| } |
| |
| @Override |
| - public float freq() throws IOException { |
| + public int freq() throws IOException { |
| int doc = subScorers[0].docID(); |
| int size = numScorers; |
| return 1 + freq(1, size, doc) + freq(2, size, doc); |
| Index: lucene/core/src/java/org/apache/lucene/search/ReqExclScorer.java |
| =================================================================== |
| --- lucene/core/src/java/org/apache/lucene/search/ReqExclScorer.java (revision 1403658) |
| +++ lucene/core/src/java/org/apache/lucene/search/ReqExclScorer.java (working copy) |
| @@ -105,7 +105,7 @@ |
| } |
| |
| @Override |
| - public float freq() throws IOException { |
| + public int freq() throws IOException { |
| return reqScorer.freq(); |
| } |
| |
| Index: lucene/core/src/java/org/apache/lucene/search/ExactPhraseScorer.java |
| =================================================================== |
| --- lucene/core/src/java/org/apache/lucene/search/ExactPhraseScorer.java (revision 1403658) |
| +++ lucene/core/src/java/org/apache/lucene/search/ExactPhraseScorer.java (working copy) |
| @@ -184,7 +184,7 @@ |
| } |
| |
| @Override |
| - public float freq() { |
| + public int freq() { |
| return freq; |
| } |
| |
| Index: lucene/core/src/java/org/apache/lucene/search/TermScorer.java |
| =================================================================== |
| --- lucene/core/src/java/org/apache/lucene/search/TermScorer.java (revision 1403658) |
| +++ lucene/core/src/java/org/apache/lucene/search/TermScorer.java (working copy) |
| @@ -55,7 +55,7 @@ |
| } |
| |
| @Override |
| - public float freq() throws IOException { |
| + public int freq() throws IOException { |
| return docsEnum.freq(); |
| } |
| |
| Index: lucene/core/src/java/org/apache/lucene/search/CachingCollector.java |
| =================================================================== |
| --- lucene/core/src/java/org/apache/lucene/search/CachingCollector.java (revision 1403658) |
| +++ lucene/core/src/java/org/apache/lucene/search/CachingCollector.java (working copy) |
| @@ -85,7 +85,7 @@ |
| public final int docID() { return doc; } |
| |
| @Override |
| - public final float freq() { throw new UnsupportedOperationException(); } |
| + public final int freq() { throw new UnsupportedOperationException(); } |
| |
| @Override |
| public final int nextDoc() { throw new UnsupportedOperationException(); } |
| Index: lucene/core/src/java/org/apache/lucene/search/ConstantScoreQuery.java |
| =================================================================== |
| --- lucene/core/src/java/org/apache/lucene/search/ConstantScoreQuery.java (revision 1403658) |
| +++ lucene/core/src/java/org/apache/lucene/search/ConstantScoreQuery.java (working copy) |
| @@ -195,7 +195,7 @@ |
| } |
| |
| @Override |
| - public float freq() throws IOException { |
| + public int freq() throws IOException { |
| return 1; |
| } |
| |
| Index: lucene/core/src/java/org/apache/lucene/search/spans/SpanWeight.java |
| =================================================================== |
| --- lucene/core/src/java/org/apache/lucene/search/spans/SpanWeight.java (revision 1403658) |
| +++ lucene/core/src/java/org/apache/lucene/search/spans/SpanWeight.java (working copy) |
| @@ -92,11 +92,11 @@ |
| |
| @Override |
| public Explanation explain(AtomicReaderContext context, int doc) throws IOException { |
| - Scorer scorer = scorer(context, true, false, context.reader().getLiveDocs()); |
| + SpanScorer scorer = (SpanScorer) scorer(context, true, false, context.reader().getLiveDocs()); |
| if (scorer != null) { |
| int newDoc = scorer.advance(doc); |
| if (newDoc == doc) { |
| - float freq = scorer.freq(); |
| + float freq = scorer.sloppyFreq(); |
| SloppySimScorer docScorer = similarity.sloppySimScorer(stats, context); |
| ComplexExplanation result = new ComplexExplanation(); |
| result.setDescription("weight("+getQuery()+" in "+doc+") [" + similarity.getClass().getSimpleName() + "], result of:"); |
| Index: lucene/core/src/java/org/apache/lucene/search/spans/SpanScorer.java |
| =================================================================== |
| --- lucene/core/src/java/org/apache/lucene/search/spans/SpanScorer.java (revision 1403658) |
| +++ lucene/core/src/java/org/apache/lucene/search/spans/SpanScorer.java (working copy) |
| @@ -33,6 +33,7 @@ |
| |
| protected int doc; |
| protected float freq; |
| + protected int numMatches; |
| protected final Similarity.SloppySimScorer docScorer; |
| |
| protected SpanScorer(Spans spans, Weight weight, Similarity.SloppySimScorer docScorer) |
| @@ -77,9 +78,11 @@ |
| } |
| doc = spans.doc(); |
| freq = 0.0f; |
| + numMatches = 0; |
| do { |
| int matchLength = spans.end() - spans.start(); |
| freq += docScorer.computeSlopFactor(matchLength); |
| + numMatches++; |
| more = spans.next(); |
| } while (more && (doc == spans.doc())); |
| return true; |
| @@ -94,7 +97,12 @@ |
| } |
| |
| @Override |
| - public float freq() throws IOException { |
| + public int freq() throws IOException { |
| + return numMatches; |
| + } |
| + |
| + /** Returns the intermediate "sloppy freq" adjusted for edit distance */ |
| + public float sloppyFreq() throws IOException { |
| return freq; |
| } |
| } |
| Index: lucene/core/src/java/org/apache/lucene/search/SloppyPhraseScorer.java |
| =================================================================== |
| --- lucene/core/src/java/org/apache/lucene/search/SloppyPhraseScorer.java (revision 1403658) |
| +++ lucene/core/src/java/org/apache/lucene/search/SloppyPhraseScorer.java (working copy) |
| @@ -43,6 +43,8 @@ |
| private PhrasePositions[][] rptGroups; // in each group are PPs that repeats each other (i.e. same term), sorted by (query) offset |
| private PhrasePositions[] rptStack; // temporary stack for switching colliding repeating pps |
| |
| + private int numMatches; |
| + |
| SloppyPhraseScorer(Weight weight, PhraseQuery.PostingsAndFreq[] postings, |
| int slop, Similarity.SloppySimScorer docScorer) { |
| super(weight, postings, docScorer); |
| @@ -75,6 +77,7 @@ |
| return 0.0f; |
| } |
| float freq = 0.0f; |
| + numMatches = 0; |
| PhrasePositions pp = pq.pop(); |
| int matchLength = end - pp.position; |
| int next = pq.top().position; |
| @@ -85,6 +88,7 @@ |
| if (pp.position > next) { // done minimizing current match-length |
| if (matchLength <= slop) { |
| freq += docScorer.computeSlopFactor(matchLength); // score match |
| + numMatches++; |
| } |
| pq.add(pp); |
| pp = pq.pop(); |
| @@ -99,6 +103,7 @@ |
| } |
| if (matchLength <= slop) { |
| freq += docScorer.computeSlopFactor(matchLength); // score match |
| + numMatches++; |
| } |
| return freq; |
| } |
| @@ -482,6 +487,11 @@ |
| } |
| return tg; |
| } |
| + |
| + @Override |
| + public int freq() throws IOException { |
| + return numMatches; |
| + } |
| |
| // private void printQueue(PrintStream ps, PhrasePositions ext, String title) { |
| // //if (min.doc != ?) return; |
| @@ -504,4 +514,5 @@ |
| // } |
| // } |
| |
| + |
| } |
| Index: lucene/join/src/java/org/apache/lucene/search/join/ToParentBlockJoinQuery.java |
| =================================================================== |
| --- lucene/join/src/java/org/apache/lucene/search/join/ToParentBlockJoinQuery.java (revision 1403658) |
| +++ lucene/join/src/java/org/apache/lucene/search/join/ToParentBlockJoinQuery.java (working copy) |
| @@ -218,7 +218,7 @@ |
| private int parentDoc = -1; |
| private int prevParentDoc; |
| private float parentScore; |
| - private float parentFreq; |
| + private int parentFreq; |
| private int nextChildDoc; |
| |
| private int[] pendingChildDocs = new int[5]; |
| @@ -300,11 +300,10 @@ |
| } |
| |
| float totalScore = 0; |
| - float totalFreq = 0; |
| float maxScore = Float.NEGATIVE_INFINITY; |
| - float maxFreq = 0; |
| |
| childDocUpto = 0; |
| + parentFreq = 0; |
| do { |
| |
| //System.out.println(" c=" + nextChildDoc); |
| @@ -318,12 +317,11 @@ |
| if (scoreMode != ScoreMode.None) { |
| // TODO: specialize this into dedicated classes per-scoreMode |
| final float childScore = childScorer.score(); |
| - final float childFreq = childScorer.freq(); |
| + final int childFreq = childScorer.freq(); |
| pendingChildScores[childDocUpto] = childScore; |
| maxScore = Math.max(childScore, maxScore); |
| - maxFreq = Math.max(childFreq, maxFreq); |
| totalScore += childScore; |
| - totalFreq += childFreq; |
| + parentFreq += childFreq; |
| } |
| childDocUpto++; |
| nextChildDoc = childScorer.nextDoc(); |
| @@ -335,15 +333,12 @@ |
| switch(scoreMode) { |
| case Avg: |
| parentScore = totalScore / childDocUpto; |
| - parentFreq = totalFreq / childDocUpto; |
| break; |
| case Max: |
| parentScore = maxScore; |
| - parentFreq = maxFreq; |
| break; |
| case Total: |
| parentScore = totalScore; |
| - parentFreq = totalFreq; |
| break; |
| case None: |
| break; |
| @@ -365,7 +360,7 @@ |
| } |
| |
| @Override |
| - public float freq() { |
| + public int freq() { |
| return parentFreq; |
| } |
| |
| Index: lucene/join/src/java/org/apache/lucene/search/join/ToParentBlockJoinCollector.java |
| =================================================================== |
| --- lucene/join/src/java/org/apache/lucene/search/join/ToParentBlockJoinCollector.java (revision 1403658) |
| +++ lucene/join/src/java/org/apache/lucene/search/join/ToParentBlockJoinCollector.java (working copy) |
| @@ -329,7 +329,7 @@ |
| } |
| |
| @Override |
| - public float freq() { |
| + public int freq() { |
| return 1; // TODO: does anything else make sense?... duplicate of grouping's FakeScorer btw? |
| } |
| |
| Index: lucene/join/src/java/org/apache/lucene/search/join/ToChildBlockJoinQuery.java |
| =================================================================== |
| --- lucene/join/src/java/org/apache/lucene/search/join/ToChildBlockJoinQuery.java (revision 1403658) |
| +++ lucene/join/src/java/org/apache/lucene/search/join/ToChildBlockJoinQuery.java (working copy) |
| @@ -169,7 +169,7 @@ |
| private final Bits acceptDocs; |
| |
| private float parentScore; |
| - private float parentFreq = 1; |
| + private int parentFreq = 1; |
| |
| private int childDoc = -1; |
| private int parentDoc; |
| @@ -258,7 +258,7 @@ |
| } |
| |
| @Override |
| - public float freq() throws IOException { |
| + public int freq() throws IOException { |
| return parentFreq; |
| } |
| |
| Index: lucene/join/src/java/org/apache/lucene/search/join/TermsIncludingScoreQuery.java |
| =================================================================== |
| --- lucene/join/src/java/org/apache/lucene/search/join/TermsIncludingScoreQuery.java (revision 1403658) |
| +++ lucene/join/src/java/org/apache/lucene/search/join/TermsIncludingScoreQuery.java (working copy) |
| @@ -219,7 +219,7 @@ |
| } |
| |
| @Override |
| - public float freq() { |
| + public int freq() { |
| return 1; |
| } |
| } |
| @@ -318,7 +318,7 @@ |
| return scores[currentDoc]; |
| } |
| |
| - public float freq() throws IOException { |
| + public int freq() throws IOException { |
| return 1; |
| } |
| |
| Index: lucene/grouping/src/java/org/apache/lucene/search/grouping/BlockGroupingCollector.java |
| =================================================================== |
| --- lucene/grouping/src/java/org/apache/lucene/search/grouping/BlockGroupingCollector.java (revision 1403658) |
| +++ lucene/grouping/src/java/org/apache/lucene/search/grouping/BlockGroupingCollector.java (working copy) |
| @@ -99,7 +99,7 @@ |
| } |
| |
| @Override |
| - public float freq() { |
| + public int freq() { |
| throw new UnsupportedOperationException(); // TODO: wtf does this class do? |
| } |
| |
| Index: lucene/queries/src/java/org/apache/lucene/queries/CustomScoreQuery.java |
| =================================================================== |
| --- lucene/queries/src/java/org/apache/lucene/queries/CustomScoreQuery.java (revision 1403658) |
| +++ lucene/queries/src/java/org/apache/lucene/queries/CustomScoreQuery.java (working copy) |
| @@ -327,7 +327,7 @@ |
| } |
| |
| @Override |
| - public float freq() throws IOException { |
| + public int freq() throws IOException { |
| return subQueryScorer.freq(); |
| } |
| |
| Index: lucene/queries/src/java/org/apache/lucene/queries/function/FunctionQuery.java |
| =================================================================== |
| --- lucene/queries/src/java/org/apache/lucene/queries/function/FunctionQuery.java (revision 1403658) |
| +++ lucene/queries/src/java/org/apache/lucene/queries/function/FunctionQuery.java (working copy) |
| @@ -159,7 +159,7 @@ |
| } |
| |
| @Override |
| - public float freq() throws IOException { |
| + public int freq() throws IOException { |
| return 1; |
| } |
| |
| Index: lucene/queries/src/java/org/apache/lucene/queries/function/ValueSourceScorer.java |
| =================================================================== |
| --- lucene/queries/src/java/org/apache/lucene/queries/function/ValueSourceScorer.java (revision 1403658) |
| +++ lucene/queries/src/java/org/apache/lucene/queries/function/ValueSourceScorer.java (working copy) |
| @@ -88,7 +88,7 @@ |
| } |
| |
| @Override |
| - public float freq() throws IOException { |
| + public int freq() throws IOException { |
| return 1; |
| } |
| } |
| Index: lucene/queries/src/java/org/apache/lucene/queries/function/BoostedQuery.java |
| =================================================================== |
| --- lucene/queries/src/java/org/apache/lucene/queries/function/BoostedQuery.java (revision 1403658) |
| +++ lucene/queries/src/java/org/apache/lucene/queries/function/BoostedQuery.java (working copy) |
| @@ -167,7 +167,7 @@ |
| } |
| |
| @Override |
| - public float freq() throws IOException { |
| + public int freq() throws IOException { |
| return scorer.freq(); |
| } |
| |
| Index: solr/core/src/java/org/apache/solr/schema/LatLonType.java |
| =================================================================== |
| --- solr/core/src/java/org/apache/solr/schema/LatLonType.java (revision 1403658) |
| +++ solr/core/src/java/org/apache/solr/schema/LatLonType.java (working copy) |
| @@ -482,7 +482,7 @@ |
| } |
| |
| @Override |
| - public float freq() throws IOException { |
| + public int freq() throws IOException { |
| return 1; |
| } |
| |
| Index: solr/core/src/java/org/apache/solr/search/SolrConstantScoreQuery.java |
| =================================================================== |
| --- solr/core/src/java/org/apache/solr/search/SolrConstantScoreQuery.java (revision 1403658) |
| +++ solr/core/src/java/org/apache/solr/search/SolrConstantScoreQuery.java (working copy) |
| @@ -188,7 +188,7 @@ |
| } |
| |
| @Override |
| - public float freq() throws IOException { |
| + public int freq() throws IOException { |
| return 1; |
| } |
| |
| Index: solr/core/src/java/org/apache/solr/search/JoinQParserPlugin.java |
| =================================================================== |
| --- solr/core/src/java/org/apache/solr/search/JoinQParserPlugin.java (revision 1403658) |
| +++ solr/core/src/java/org/apache/solr/search/JoinQParserPlugin.java (working copy) |
| @@ -534,7 +534,7 @@ |
| } |
| |
| @Override |
| - public float freq() throws IOException { |
| + public int freq() throws IOException { |
| return 1; |
| } |
| |