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 2022/03/05 17:33:04 UTC
[lucene] branch branch_9x updated (5e539bc -> 29282fa)
This is an automated email from the ASF dual-hosted git repository.
jpountz pushed a change to branch branch_9x
in repository https://gitbox.apache.org/repos/asf/lucene.git.
from 5e539bc LUCENE-10431: Don't include rewriteMethod in MTQ hash calculation (#727)
new ffdb246 LUCENE-10455: IndexSortSortedNumericDocValuesRangeQuery should implement Weight#scorerSupplier(LeafReaderContext) (#729)
new 29282fa LUCENE-10455: CHANGES entry.
The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
lucene/CHANGES.txt | 2 ++
.../IndexSortSortedNumericDocValuesRangeQuery.java | 28 +++++++++++++++++++---
2 files changed, 27 insertions(+), 3 deletions(-)
[lucene] 01/02: LUCENE-10455: IndexSortSortedNumericDocValuesRangeQuery should implement Weight#scorerSupplier(LeafReaderContext) (#729)
Posted by jp...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
jpountz pushed a commit to branch branch_9x
in repository https://gitbox.apache.org/repos/asf/lucene.git
commit ffdb246702f42a3b95193993f79064056fedd095
Author: Chris Lu <q1...@Gmail.com>
AuthorDate: Sun Mar 6 01:27:29 2022 +0800
LUCENE-10455: IndexSortSortedNumericDocValuesRangeQuery should implement Weight#scorerSupplier(LeafReaderContext) (#729)
---
.../IndexSortSortedNumericDocValuesRangeQuery.java | 28 +++++++++++++++++++---
1 file changed, 25 insertions(+), 3 deletions(-)
diff --git a/lucene/sandbox/src/java/org/apache/lucene/sandbox/search/IndexSortSortedNumericDocValuesRangeQuery.java b/lucene/sandbox/src/java/org/apache/lucene/sandbox/search/IndexSortSortedNumericDocValuesRangeQuery.java
index 58f27e5..1dc80af 100644
--- a/lucene/sandbox/src/java/org/apache/lucene/sandbox/search/IndexSortSortedNumericDocValuesRangeQuery.java
+++ b/lucene/sandbox/src/java/org/apache/lucene/sandbox/search/IndexSortSortedNumericDocValuesRangeQuery.java
@@ -35,6 +35,7 @@ import org.apache.lucene.search.Query;
import org.apache.lucene.search.QueryVisitor;
import org.apache.lucene.search.ScoreMode;
import org.apache.lucene.search.Scorer;
+import org.apache.lucene.search.ScorerSupplier;
import org.apache.lucene.search.Sort;
import org.apache.lucene.search.SortField;
import org.apache.lucene.search.Weight;
@@ -158,13 +159,34 @@ public class IndexSortSortedNumericDocValuesRangeQuery extends Query {
Weight fallbackWeight = fallbackQuery.createWeight(searcher, scoreMode, boost);
return new ConstantScoreWeight(this, boost) {
+
@Override
- public Scorer scorer(LeafReaderContext context) throws IOException {
+ public ScorerSupplier scorerSupplier(LeafReaderContext context) throws IOException {
+ final Weight weight = this;
DocIdSetIterator disi = getDocIdSetIteratorOrNull(context);
if (disi != null) {
- return new ConstantScoreScorer(this, score(), scoreMode, disi);
+ return new ScorerSupplier() {
+ @Override
+ public Scorer get(long leadCost) throws IOException {
+ return new ConstantScoreScorer(weight, score(), scoreMode, disi);
+ }
+
+ @Override
+ public long cost() {
+ return disi.cost();
+ }
+ };
+ }
+ return fallbackWeight.scorerSupplier(context);
+ }
+
+ @Override
+ public Scorer scorer(LeafReaderContext context) throws IOException {
+ ScorerSupplier scorerSupplier = scorerSupplier(context);
+ if (scorerSupplier == null) {
+ return null;
}
- return fallbackWeight.scorer(context);
+ return scorerSupplier.get(Long.MAX_VALUE);
}
@Override
[lucene] 02/02: LUCENE-10455: CHANGES entry.
Posted by jp...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
jpountz pushed a commit to branch branch_9x
in repository https://gitbox.apache.org/repos/asf/lucene.git
commit 29282fa315b723b32f8e788ba29e2311f7ece83f
Author: Adrien Grand <jp...@gmail.com>
AuthorDate: Sat Mar 5 18:29:23 2022 +0100
LUCENE-10455: CHANGES entry.
---
lucene/CHANGES.txt | 2 ++
1 file changed, 2 insertions(+)
diff --git a/lucene/CHANGES.txt b/lucene/CHANGES.txt
index 010b442..4a6b563 100644
--- a/lucene/CHANGES.txt
+++ b/lucene/CHANGES.txt
@@ -206,6 +206,8 @@ Optimizations
* LUCENE-10450: IndexSortSortedNumericDocValuesRangeQuery could be rewrite to MatchAllDocsQuery. (Lu Xugang)
+* LUCENE-10455: IndexSortSortedNumericDocValuesRangeQuery now implements the scorerSupplier API. (Lu Xugang)
+
Changes in runtime behavior
---------------------