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 2014/01/27 22:17:24 UTC

svn commit: r1561851 - in /lucene/dev/trunk/solr: CHANGES.txt core/src/java/org/apache/solr/update/VersionInfo.java

Author: yonik
Date: Mon Jan 27 21:17:23 2014
New Revision: 1561851

URL: http://svn.apache.org/r1561851
Log:
allow _version_ to use DocValues

Modified:
    lucene/dev/trunk/solr/CHANGES.txt
    lucene/dev/trunk/solr/core/src/java/org/apache/solr/update/VersionInfo.java

Modified: lucene/dev/trunk/solr/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/CHANGES.txt?rev=1561851&r1=1561850&r2=1561851&view=diff
==============================================================================
--- lucene/dev/trunk/solr/CHANGES.txt (original)
+++ lucene/dev/trunk/solr/CHANGES.txt Mon Jan 27 21:17:23 2014
@@ -158,6 +158,9 @@ New Features
   automatically for an RPT field type.  See Spatial4j CHANGES & javadocs.
   https://github.com/spatial4j/spatial4j/blob/master/CHANGES.md  (David Smiley)
 
+* SOLR-5670: allow _version_ to use DocValues.  (Per Steffensen via yonik)
+
+
 Bug Fixes
 ----------------------
 

Modified: lucene/dev/trunk/solr/core/src/java/org/apache/solr/update/VersionInfo.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/java/org/apache/solr/update/VersionInfo.java?rev=1561851&r1=1561850&r2=1561851&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/java/org/apache/solr/update/VersionInfo.java (original)
+++ lucene/dev/trunk/solr/core/src/java/org/apache/solr/update/VersionInfo.java Mon Jan 27 21:17:23 2014
@@ -49,7 +49,7 @@ public class VersionInfo {
    */
   public static SchemaField getAndCheckVersionField(IndexSchema schema) 
     throws SolrException {
-    final String errPrefix = VERSION_FIELD + " field must exist in schema, using indexed=\"true\" stored=\"true\" and multiValued=\"false\"";
+    final String errPrefix = VERSION_FIELD + " field must exist in schema, using indexed=\"true\" or docValues=\"true\", stored=\"true\" and multiValued=\"false\"";
     SchemaField sf = schema.getFieldOrNull(VERSION_FIELD);
 
     if (null == sf) {
@@ -57,10 +57,10 @@ public class VersionInfo {
         (SolrException.ErrorCode.SERVER_ERROR, 
          errPrefix + " (" + VERSION_FIELD + " does not exist)");
     }
-    if ( !sf.indexed() ) {
+    if ( !sf.indexed() && !sf.hasDocValues()) {
       throw new SolrException
         (SolrException.ErrorCode.SERVER_ERROR, 
-         errPrefix + " (" + VERSION_FIELD + " is not indexed");
+         errPrefix + " (" + VERSION_FIELD + " must be either indexed or have docValues");
     }
     if ( !sf.stored() ) {
       throw new SolrException