lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rm...@apache.org
Subject svn commit: r1386789 - in /lucene/dev/branches/lucene_solr_3_6: ./ lucene/ lucene/CHANGES.txt lucene/core/src/ lucene/core/src/java/org/apache/lucene/search/ConstantScoreQuery.java lucene/core/src/java/org/apache/lucene/search/DisjunctionSumScorer.java
Date Mon, 17 Sep 2012 19:37:24 GMT
Author: rmuir
Date: Mon Sep 17 19:37:24 2012
New Revision: 1386789

URL: http://svn.apache.org/viewvc?rev=1386789&view=rev
Log:
LUCENE-4401: don't call score() on NO_MORE_DOCS in DisjunctionSumScorer (unreleased bug, caused
by LUCENE-3505)

Modified:
    lucene/dev/branches/lucene_solr_3_6/   (props changed)
    lucene/dev/branches/lucene_solr_3_6/lucene/   (props changed)
    lucene/dev/branches/lucene_solr_3_6/lucene/CHANGES.txt
    lucene/dev/branches/lucene_solr_3_6/lucene/core/src/   (props changed)
    lucene/dev/branches/lucene_solr_3_6/lucene/core/src/java/org/apache/lucene/search/ConstantScoreQuery.java
    lucene/dev/branches/lucene_solr_3_6/lucene/core/src/java/org/apache/lucene/search/DisjunctionSumScorer.java

Modified: lucene/dev/branches/lucene_solr_3_6/lucene/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene_solr_3_6/lucene/CHANGES.txt?rev=1386789&r1=1386788&r2=1386789&view=diff
==============================================================================
--- lucene/dev/branches/lucene_solr_3_6/lucene/CHANGES.txt (original)
+++ lucene/dev/branches/lucene_solr_3_6/lucene/CHANGES.txt Mon Sep 17 19:37:24 2012
@@ -10,8 +10,9 @@ Bug Fixes:
 * LUCENE-4234: Exception when FacetsCollector is used with ScoreFacetRequest, 
   and the number of matching documents is too large. (Gilad Barkai via Shai Erera)
 
-* LUCENE-2686, LUCENE-3505: Fix BooleanQuery scorers to return correct freq().
-  (Koji Sekiguchi, Mike McCandless, Robert Muir)
+* LUCENE-2686, LUCENE-3505, LUCENE-4401: Fix BooleanQuery scorers to 
+  return correct freq().
+  (Koji Sekiguchi, Mike McCandless, Liu Chao, Robert Muir)
 
 * LUCENE-2501: Fixed rare thread-safety issue that could cause
   ArrayIndexOutOfBoundsException inside ByteBlockPool (Robert Muir,

Modified: lucene/dev/branches/lucene_solr_3_6/lucene/core/src/java/org/apache/lucene/search/ConstantScoreQuery.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene_solr_3_6/lucene/core/src/java/org/apache/lucene/search/ConstantScoreQuery.java?rev=1386789&r1=1386788&r2=1386789&view=diff
==============================================================================
--- lucene/dev/branches/lucene_solr_3_6/lucene/core/src/java/org/apache/lucene/search/ConstantScoreQuery.java
(original)
+++ lucene/dev/branches/lucene_solr_3_6/lucene/core/src/java/org/apache/lucene/search/ConstantScoreQuery.java
Mon Sep 17 19:37:24 2012
@@ -198,6 +198,7 @@ public class ConstantScoreQuery extends 
 
     @Override
     public float score() throws IOException {
+      assert docIdSetIterator.docID() != NO_MORE_DOCS;
       return theScore;
     }
 

Modified: lucene/dev/branches/lucene_solr_3_6/lucene/core/src/java/org/apache/lucene/search/DisjunctionSumScorer.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene_solr_3_6/lucene/core/src/java/org/apache/lucene/search/DisjunctionSumScorer.java?rev=1386789&r1=1386788&r2=1386789&view=diff
==============================================================================
--- lucene/dev/branches/lucene_solr_3_6/lucene/core/src/java/org/apache/lucene/search/DisjunctionSumScorer.java
(original)
+++ lucene/dev/branches/lucene_solr_3_6/lucene/core/src/java/org/apache/lucene/search/DisjunctionSumScorer.java
Mon Sep 17 19:37:24 2012
@@ -68,6 +68,7 @@ class DisjunctionSumScorer extends Disju
 
   @Override
   public int nextDoc() throws IOException {
+    assert doc != NO_MORE_DOCS;
     while(true) {
       while (subScorers[0].docID() == doc) {
         if (subScorers[0].nextDoc() != NO_MORE_DOCS) {
@@ -91,10 +92,14 @@ class DisjunctionSumScorer extends Disju
   private void afterNext() throws IOException {
     final Scorer sub = subScorers[0];
     doc = sub.docID();
-    score = sub.score();
-    nrMatchers = 1;
-    countMatches(1);
-    countMatches(2);
+    if (doc == NO_MORE_DOCS) {
+      nrMatchers = Integer.MAX_VALUE; // stop looping
+    } else {
+      score = sub.score();
+      nrMatchers = 1;
+      countMatches(1);
+      countMatches(2);
+    }
   }
   
   // TODO: this currently scores, but so did the previous impl



Mime
View raw message