This is an automated email from the ASF dual-hosted git repository.

noble pushed a commit to branch ishan/upgrade-to-lucene-10
in repository https://gitbox.apache.org/repos/asf/solr.git


The following commit(s) were added to refs/heads/ishan/upgrade-to-lucene-10 by 
this push:
     new f5df6c7cd4c bulk scorer modified
f5df6c7cd4c is described below

commit f5df6c7cd4c483065ed396ab2d901aa7051be4cb
Author: noblepaul <[email protected]>
AuthorDate: Fri Jan 17 18:24:13 2025 +0530

    bulk scorer modified
---
 .../java/org/apache/solr/query/SolrRangeQuery.java | 41 ++++++++++++++++------
 1 file changed, 31 insertions(+), 10 deletions(-)

diff --git a/solr/core/src/java/org/apache/solr/query/SolrRangeQuery.java 
b/solr/core/src/java/org/apache/solr/query/SolrRangeQuery.java
index 03a50758496..57e08bab9c7 100644
--- a/solr/core/src/java/org/apache/solr/query/SolrRangeQuery.java
+++ b/solr/core/src/java/org/apache/solr/query/SolrRangeQuery.java
@@ -365,6 +365,8 @@ public final class SolrRangeQuery extends ExtendedQueryBase 
implements DocSetPro
       this.scoreMode = scoreMode;
     }
 
+
+
     // See MultiTermQueryConstantScoreWrapper matches()
     @Override
     public Matches matches(LeafReaderContext context, int doc) throws 
IOException {
@@ -518,30 +520,49 @@ public final class SolrRangeQuery extends 
ExtendedQueryBase implements DocSetPro
       return new SolrDefaultScorerSupplier(new ConstantScoreScorer(score(), 
scoreMode, disi));
     }
 
-    //TBD already implements a scorerSupplier() . So this need not be 
overridden
 
- /*   @Override
-    public BulkScorer bulkScorer(LeafReaderContext context) throws IOException 
{
+
+    private BulkScorer bulk(LeafReaderContext context) throws IOException {
       final SegState weightOrBitSet = getSegState(context);
       if (weightOrBitSet.weight != null) {
         return weightOrBitSet.weight.bulkScorer(context);
       } else {
-        final Scorer scorer = scorer(weightOrBitSet.set);
+        final Scorer scorer = scorer(context);
         if (scorer == null) {
           return null;
         }
         return new DefaultBulkScorer(scorer);
       }
-    }*/
+    }
+    //TBD Some tests in BasicFunctionalityTest is still failing
 
     @Override
     public ScorerSupplier scorerSupplier(LeafReaderContext context) throws 
IOException {
       final SegState weightOrBitSet = getSegState(context);
-      if (weightOrBitSet.weight != null) {
-        return new 
SolrDefaultScorerSupplier(weightOrBitSet.weight.scorer(context));
-      } else {
-        return scorerSupplier(weightOrBitSet.set);
-      }
+      ScorerSupplier ss = weightOrBitSet.weight != null ?
+              new 
SolrDefaultScorerSupplier(weightOrBitSet.weight.scorer(context)):
+              scorerSupplier(weightOrBitSet.set);
+
+      BulkScorer bulkScorer = bulk(context);
+
+      return new ScorerSupplier() {
+        @Override
+        public Scorer get(long leadCost) throws IOException {
+          return ss.get(leadCost);
+        }
+
+        @Override
+        public long cost() {
+          return ss.cost();
+        }
+
+        @Override
+        public BulkScorer bulkScorer() throws IOException {
+          return bulkScorer;
+        }
+
+      };
+
     }
 
     @Override

Reply via email to