SOLR-12964: Use DocValuesIterator.advanceExact() instead of the advance()/docID() pattern

This commit is contained in:
Tim Underwood 2018-11-08 14:34:17 -05:00 committed by David Smiley
parent 1b084db901
commit 243a8a668a
3 changed files with 5 additions and 8 deletions

View File

@ -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.

View File

@ -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);
}

View File

@ -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);