This is an automated email from the ASF dual-hosted git repository.
ishan 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 31cc140ded7 Use a MatchNoDocsQuery's scorer when range query has no
matches
31cc140ded7 is described below
commit 31cc140ded719913f31e7124d4ba2b8fc7be1854
Author: Ishan Chattopadhyaya <[email protected]>
AuthorDate: Tue Mar 11 08:57:46 2025 +0530
Use a MatchNoDocsQuery's scorer when range query has no matches
---
.../java/org/apache/solr/query/SolrRangeQuery.java | 42 +---------------------
1 file changed, 1 insertion(+), 41 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 396483c38db..7c395ae9823 100644
--- a/solr/core/src/java/org/apache/solr/query/SolrRangeQuery.java
+++ b/solr/core/src/java/org/apache/solr/query/SolrRangeQuery.java
@@ -542,47 +542,7 @@ public final class SolrRangeQuery extends
ExtendedQueryBase implements DocSetPro
public ScorerSupplier scorerSupplier(LeafReaderContext context) throws
IOException {
Scorer sc = scorerInternal(context);
if (sc == null) {
- sc = new Scorer() {
- @Override
- public int docID() {
- return -1;
- }
-
- @Override
- public DocIdSetIterator iterator() {
- return new DocIdSetIterator() {
- @Override
- public int docID() {
- return -1;
- }
-
- @Override
- public int nextDoc() throws IOException {
- return DocIdSetIterator.NO_MORE_DOCS;
- }
-
- @Override
- public int advance(int target) throws IOException {
- return DocIdSetIterator.NO_MORE_DOCS;
- }
-
- @Override
- public long cost() {
- return 0;
- }
- };
- }
-
- @Override
- public float getMaxScore(int upTo) throws IOException {
- return 0;
- }
-
- @Override
- public float score() throws IOException {
- return 0;
- }
- };
+ return new MatchNoDocsQuery().createWeight(searcher,
ScoreMode.COMPLETE, 0f).scorerSupplier(context);
}
final Scorer scorer = sc;