You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ho...@apache.org on 2016/03/12 01:27:28 UTC

[47/50] [abbrv] lucene-solr git commit: SOLR-8831: allow _version_ field to be retrievable via docValues

SOLR-8831: allow _version_ field to be retrievable via docValues


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

Branch: refs/heads/jira/SOLR-445
Commit: 50c413e865a166de7ba72bf8c3affb5702c2fb62
Parents: fe21f7a
Author: yonik <yo...@apache.org>
Authored: Fri Mar 11 14:10:37 2016 -0500
Committer: yonik <yo...@apache.org>
Committed: Fri Mar 11 14:10:37 2016 -0500

----------------------------------------------------------------------
 solr/CHANGES.txt                                           | 2 ++
 solr/core/src/java/org/apache/solr/update/VersionInfo.java | 8 ++++----
 2 files changed, 6 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/50c413e8/solr/CHANGES.txt
----------------------------------------------------------------------
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index 1d91a3e..bb36297 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -195,6 +195,8 @@ New Features
 
 * SOLR-8698: params.json can now specify 'appends' and 'invariants' (noble)
 
+* SOLR-8831: allow _version_ field to be retrievable via docValues (yonik)
+
 
 Bug Fixes
 ----------------------

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/50c413e8/solr/core/src/java/org/apache/solr/update/VersionInfo.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/update/VersionInfo.java b/solr/core/src/java/org/apache/solr/update/VersionInfo.java
index d5eebec..5fe415c 100644
--- a/solr/core/src/java/org/apache/solr/update/VersionInfo.java
+++ b/solr/core/src/java/org/apache/solr/update/VersionInfo.java
@@ -61,7 +61,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\" or docValues=\"true\", stored=\"true\" and multiValued=\"false\"";
+    final String errPrefix = VERSION_FIELD + " field must exist in schema and be searchable (indexed or docValues) and retrievable(stored or docValues) and not multiValued";
     SchemaField sf = schema.getFieldOrNull(VERSION_FIELD);
 
     if (null == sf) {
@@ -72,12 +72,12 @@ public class VersionInfo {
     if ( !sf.indexed() && !sf.hasDocValues()) {
       throw new SolrException
         (SolrException.ErrorCode.SERVER_ERROR, 
-         errPrefix + " (" + VERSION_FIELD + " must be either indexed or have docValues");
+         errPrefix + " (" + VERSION_FIELD + " not searchable");
     }
-    if ( !sf.stored() ) {
+    if ( !sf.stored() && !sf.hasDocValues()) {
       throw new SolrException
         (SolrException.ErrorCode.SERVER_ERROR, 
-         errPrefix + " (" + VERSION_FIELD + " is not stored");
+         errPrefix + " (" + VERSION_FIELD + " not retrievable");
     }
     if ( sf.multiValued() ) {
       throw new SolrException