lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jpou...@apache.org
Subject svn commit: r1700759 - in /lucene/dev/branches/branch_5x: ./ lucene/ lucene/CHANGES.txt lucene/core/ lucene/core/src/java/org/apache/lucene/search/MatchAllDocsQuery.java
Date Wed, 02 Sep 2015 10:23:25 GMT
Author: jpountz
Date: Wed Sep  2 10:23:24 2015
New Revision: 1700759

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

Modified:
    lucene/dev/branches/branch_5x/   (props changed)
    lucene/dev/branches/branch_5x/lucene/   (props changed)
    lucene/dev/branches/branch_5x/lucene/CHANGES.txt   (contents, props changed)
    lucene/dev/branches/branch_5x/lucene/core/   (props changed)
    lucene/dev/branches/branch_5x/lucene/core/src/java/org/apache/lucene/search/MatchAllDocsQuery.java

Modified: lucene/dev/branches/branch_5x/lucene/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/lucene/CHANGES.txt?rev=1700759&r1=1700758&r2=1700759&view=diff
==============================================================================
--- lucene/dev/branches/branch_5x/lucene/CHANGES.txt (original)
+++ lucene/dev/branches/branch_5x/lucene/CHANGES.txt Wed Sep  2 10:23:24 2015
@@ -72,6 +72,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/branches/branch_5x/lucene/core/src/java/org/apache/lucene/search/MatchAllDocsQuery.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/lucene/core/src/java/org/apache/lucene/search/MatchAllDocsQuery.java?rev=1700759&r1=1700758&r2=1700759&view=diff
==============================================================================
--- lucene/dev/branches/branch_5x/lucene/core/src/java/org/apache/lucene/search/MatchAllDocsQuery.java
(original)
+++ lucene/dev/branches/branch_5x/lucene/core/src/java/org/apache/lucene/search/MatchAllDocsQuery.java
Wed Sep  2 10:23:24 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();



Mime
View raw message