You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by jp...@apache.org on 2015/09/02 12:18:35 UTC

svn commit: r1700754 - in /lucene/dev/trunk/lucene: CHANGES.txt core/src/java/org/apache/lucene/search/MatchAllDocsQuery.java

Author: jpountz
Date: Wed Sep  2 10:18:35 2015
New Revision: 1700754

URL: http://svn.apache.org/r1700754
Log:
LUCENE-6761: MatchAllDocsQuery's Scorers do not expose approximations anymore.

Modified:
    lucene/dev/trunk/lucene/CHANGES.txt
    lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/search/MatchAllDocsQuery.java

Modified: lucene/dev/trunk/lucene/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/CHANGES.txt?rev=1700754&r1=1700753&r2=1700754&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/CHANGES.txt (original)
+++ lucene/dev/trunk/lucene/CHANGES.txt Wed Sep  2 10:18:35 2015
@@ -119,6 +119,9 @@ Other
 * LUCENE-6768: AbstractFirstPassGroupingCollector.groupSort private member
   is not needed. (Christine Poerschke)
 
+* LUCENE-6761: MatchAllDocsQuery's Scorers do not expose approximations
+  anymore. (Adrien Grand)
+
 Build
 
 * LUCENE-6732: Improve checker for invalid source patterns to also

Modified: lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/search/MatchAllDocsQuery.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/search/MatchAllDocsQuery.java?rev=1700754&r1=1700753&r2=1700754&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/search/MatchAllDocsQuery.java (original)
+++ lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/search/MatchAllDocsQuery.java Wed Sep  2 10:18:35 2015
@@ -31,16 +31,16 @@ public final class MatchAllDocsQuery ext
 
   @Override
   public Weight createWeight(IndexSearcher searcher, boolean needsScores) {
-    return new RandomAccessWeight(this) {
-      @Override
-      protected Bits getMatchingDocs(LeafReaderContext context) throws IOException {
-        return new Bits.MatchAllBits(context.reader().maxDoc());
-      }
+    return new ConstantScoreWeight(this) {
       @Override
       public String toString() {
         return "weight(" + MatchAllDocsQuery.this + ")";
       }
       @Override
+      public Scorer scorer(LeafReaderContext context) throws IOException {
+        return new ConstantScoreScorer(this, score(), DocIdSetIterator.all(context.reader().maxDoc()));
+      }
+      @Override
       public BulkScorer bulkScorer(LeafReaderContext context) throws IOException {
         final float score = score();
         final int maxDoc = context.reader().maxDoc();