You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ds...@apache.org on 2019/09/26 19:57:31 UTC
[lucene-solr] branch branch_8x updated: LUCENE-8980: Blocktree
seekExact now checks min-max range of the segment
This is an automated email from the ASF dual-hosted git repository.
dsmiley pushed a commit to branch branch_8x
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git
The following commit(s) were added to refs/heads/branch_8x by this push:
new 4df2702 LUCENE-8980: Blocktree seekExact now checks min-max range of the segment
4df2702 is described below
commit 4df2702cdbf2195ddc5e8623231d903f6908e693
Author: johngqjiang <jo...@tencent.com>
AuthorDate: Thu Sep 26 15:57:22 2019 -0400
LUCENE-8980: Blocktree seekExact now checks min-max range of the segment
(cherry picked from commit 99f4cec459177caeb16644e4592d807d125c1613)
---
lucene/CHANGES.txt | 3 +++
.../src/java/org/apache/lucene/codecs/blocktree/SegmentTermsEnum.java | 4 ++++
2 files changed, 7 insertions(+)
diff --git a/lucene/CHANGES.txt b/lucene/CHANGES.txt
index bdb819d..6b941f1 100644
--- a/lucene/CHANGES.txt
+++ b/lucene/CHANGES.txt
@@ -103,6 +103,9 @@ the total hits is not requested.
* LUCENE-8939: Introduce shared count based early termination across multiple slices
(Atri Sharma)
+* LUCENE-8980: Blocktree's seekExact now short-circuits false if the term isn't in the min-max range of the segment.
+ Large perf gain for ID/time like data when populated sequentially. (Guoqiang Jiang)
+
Bug Fixes
* LUCENE-8755: spatial-extras quad and packed quad prefix trees could throw a
diff --git a/lucene/core/src/java/org/apache/lucene/codecs/blocktree/SegmentTermsEnum.java b/lucene/core/src/java/org/apache/lucene/codecs/blocktree/SegmentTermsEnum.java
index c9d0ddf..56b6843 100644
--- a/lucene/core/src/java/org/apache/lucene/codecs/blocktree/SegmentTermsEnum.java
+++ b/lucene/core/src/java/org/apache/lucene/codecs/blocktree/SegmentTermsEnum.java
@@ -321,6 +321,10 @@ final class SegmentTermsEnum extends BaseTermsEnum {
throw new IllegalStateException("terms index was not loaded");
}
+ if (fr.size() > 0 && (target.compareTo(fr.getMin()) < 0 || target.compareTo(fr.getMax()) > 0)) {
+ return false;
+ }
+
term.grow(1 + target.length);
assert clearEOF();