You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by yo...@apache.org on 2016/03/24 04:05:07 UTC

lucene-solr:master: LUCENE-7119: allow bypass of docvalues check in DocTermOrds

Repository: lucene-solr
Updated Branches:
  refs/heads/master e136d1081 -> cb4190303


LUCENE-7119: allow bypass of docvalues check in DocTermOrds


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

Branch: refs/heads/master
Commit: cb41903039caaa267a09c5f2327659c8cf548706
Parents: e136d10
Author: yonik <yo...@apache.org>
Authored: Wed Mar 23 23:04:50 2016 -0400
Committer: yonik <yo...@apache.org>
Committed: Wed Mar 23 23:04:50 2016 -0400

----------------------------------------------------------------------
 .../src/java/org/apache/lucene/uninverting/DocTermOrds.java    | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/cb419030/lucene/misc/src/java/org/apache/lucene/uninverting/DocTermOrds.java
----------------------------------------------------------------------
diff --git a/lucene/misc/src/java/org/apache/lucene/uninverting/DocTermOrds.java b/lucene/misc/src/java/org/apache/lucene/uninverting/DocTermOrds.java
index 6ef09ce..3600acd 100644
--- a/lucene/misc/src/java/org/apache/lucene/uninverting/DocTermOrds.java
+++ b/lucene/misc/src/java/org/apache/lucene/uninverting/DocTermOrds.java
@@ -163,6 +163,10 @@ public class DocTermOrds implements Accountable {
   /** Used while uninverting. */
   protected PostingsEnum postingsEnum;
 
+  /** If true, check and throw an exception if the field has docValues enabled.
+   * Normally, docValues should be used in preference to DocTermOrds. */
+  protected boolean checkForDocValues = true;
+
   /** Returns total bytes used. */
   public long ramBytesUsed() {
     // can cache the mem size since it shouldn't change
@@ -268,7 +272,7 @@ public class DocTermOrds implements Accountable {
   /** Call this only once (if you subclass!) */
   protected void uninvert(final LeafReader reader, Bits liveDocs, final BytesRef termPrefix) throws IOException {
     final FieldInfo info = reader.getFieldInfos().fieldInfo(field);
-    if (info != null && info.getDocValuesType() != DocValuesType.NONE) {
+    if (checkForDocValues && info != null && info.getDocValuesType() != DocValuesType.NONE) {
       throw new IllegalStateException("Type mismatch: " + field + " was indexed as " + info.getDocValuesType());
     }
     //System.out.println("DTO uninvert field=" + field + " prefix=" + termPrefix);