From 19c7f8eacfccbe751279e6852fe6ec856403e658 Mon Sep 17 00:00:00 2001 From: Anshum Gupta Date: Sun, 16 Oct 2016 19:07:40 -0700 Subject: [PATCH] SOLR-9628: Set lastDocId in Trie fields --- solr/core/src/java/org/apache/solr/schema/TrieDoubleField.java | 1 + solr/core/src/java/org/apache/solr/schema/TrieIntField.java | 1 + solr/core/src/java/org/apache/solr/schema/TrieLongField.java | 1 + 3 files changed, 3 insertions(+) diff --git a/solr/core/src/java/org/apache/solr/schema/TrieDoubleField.java b/solr/core/src/java/org/apache/solr/schema/TrieDoubleField.java index 3891602237c..7faa38cd036 100644 --- a/solr/core/src/java/org/apache/solr/schema/TrieDoubleField.java +++ b/solr/core/src/java/org/apache/solr/schema/TrieDoubleField.java @@ -82,6 +82,7 @@ public class TrieDoubleField extends TrieField implements DoubleValueFieldType { throw new IllegalArgumentException("docs out of order: lastDocID=" + lastDocID + " docID=" + docID); } if (docID > view.docID()) { + lastDocID = docID; return docID == view.advance(docID); } else { return docID == view.docID(); diff --git a/solr/core/src/java/org/apache/solr/schema/TrieIntField.java b/solr/core/src/java/org/apache/solr/schema/TrieIntField.java index dedb66787e8..d89dd0d2d60 100644 --- a/solr/core/src/java/org/apache/solr/schema/TrieIntField.java +++ b/solr/core/src/java/org/apache/solr/schema/TrieIntField.java @@ -80,6 +80,7 @@ public class TrieIntField extends TrieField implements IntValueFieldType { throw new IllegalArgumentException("docs out of order: lastDocID=" + lastDocID + " docID=" + docID); } if (docID > view.docID()) { + lastDocID = docID; return docID == view.advance(docID); } else { return docID == view.docID(); diff --git a/solr/core/src/java/org/apache/solr/schema/TrieLongField.java b/solr/core/src/java/org/apache/solr/schema/TrieLongField.java index 229900ca883..c3a54409e3e 100644 --- a/solr/core/src/java/org/apache/solr/schema/TrieLongField.java +++ b/solr/core/src/java/org/apache/solr/schema/TrieLongField.java @@ -80,6 +80,7 @@ public class TrieLongField extends TrieField implements LongValueFieldType { throw new IllegalArgumentException("docs out of order: lastDocID=" + lastDocID + " docID=" + docID); } if (docID > view.docID()) { + lastDocID = docID; return docID == view.advance(docID); } else { return docID == view.docID();