lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From da...@apache.org
Subject [28/50] [abbrv] lucene-solr:jira/http2: SOLR-12964: Use DocValuesIterator.advanceExact() instead of the advance()/docID() pattern
Date Mon, 12 Nov 2018 11:55:37 GMT
SOLR-12964: Use DocValuesIterator.advanceExact() instead of the advance()/docID() pattern


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/243a8a66
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/243a8a66
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/243a8a66

Branch: refs/heads/jira/http2
Commit: 243a8a668a613835e3c114f6e5c31a098699840e
Parents: 1b084db
Author: Tim Underwood <timunderwood@gmail.com>
Authored: Thu Nov 8 14:34:17 2018 -0500
Committer: David Smiley <dsmiley@apache.org>
Committed: Thu Nov 8 14:34:17 2018 -0500

----------------------------------------------------------------------
 solr/CHANGES.txt                                                | 3 +++
 .../apache/solr/search/facet/FacetFieldProcessorByHashDV.java   | 5 +----
 .../org/apache/solr/search/facet/UniqueSinglevaluedSlotAcc.java | 5 +----
 3 files changed, 5 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/243a8a66/solr/CHANGES.txt
----------------------------------------------------------------------
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index 2f04c03..b8f9f18 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -293,6 +293,9 @@ Improvements
 * LUCENE-8557: Some internal LeafReader.getFieldInfos implementations were being re-computed
on-demand instead of
   once up front leading to some slowdowns in places like JSON Facets and field collapsing.
(Tim Underwood, David Smiley)
 
+* SOLR-12964: Json Facets: use DocValuesIterator advanceExact() instead of advance() in FacetFieldProcessorByHashDV
and
+  UniqueSinglevaluedSlotAcc. (Tim Underwood)
+
 ==================  7.5.0 ==================
 
 Consult the LUCENE_CHANGES.txt file for additional, low level, changes in this release.

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/243a8a66/solr/core/src/java/org/apache/solr/search/facet/FacetFieldProcessorByHashDV.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/search/facet/FacetFieldProcessorByHashDV.java
b/solr/core/src/java/org/apache/solr/search/facet/FacetFieldProcessorByHashDV.java
index 5070a97..38feddd 100644
--- a/solr/core/src/java/org/apache/solr/search/facet/FacetFieldProcessorByHashDV.java
+++ b/solr/core/src/java/org/apache/solr/search/facet/FacetFieldProcessorByHashDV.java
@@ -361,10 +361,7 @@ class FacetFieldProcessorByHashDV extends FacetFieldProcessor {
 
           @Override
           public void collect(int segDoc) throws IOException {
-            if (segDoc > docValues.docID()) {
-              docValues.advance(segDoc);
-            }
-            if (segDoc == docValues.docID()) {
+            if (docValues.advanceExact(segDoc)) {
               long val = toGlobal.get(docValues.ordValue());
               collectValFirstPhase(segDoc, val);
             }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/243a8a66/solr/core/src/java/org/apache/solr/search/facet/UniqueSinglevaluedSlotAcc.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/search/facet/UniqueSinglevaluedSlotAcc.java
b/solr/core/src/java/org/apache/solr/search/facet/UniqueSinglevaluedSlotAcc.java
index ed51c5b..6057dd0 100644
--- a/solr/core/src/java/org/apache/solr/search/facet/UniqueSinglevaluedSlotAcc.java
+++ b/solr/core/src/java/org/apache/solr/search/facet/UniqueSinglevaluedSlotAcc.java
@@ -75,10 +75,7 @@ class UniqueSinglevaluedSlotAcc extends UniqueSlotAcc {
 
   @Override
   public void collect(int doc, int slotNum, IntFunction<SlotContext> slotContext) throws
IOException {
-    if (doc > subDv.docID()) {
-      subDv.advance(doc);
-    }
-    if (doc == subDv.docID()) {
+    if (subDv.advanceExact(doc)) {
       int segOrd = subDv.ordValue();
       int ord = toGlobal==null ? segOrd : (int)toGlobal.get(segOrd);
 


Mime
View raw message