allow _version_ to use DocValues

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1561851 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Yonik Seeley 2014-01-27 21:17:23 +00:00
parent a193836b86
commit f15097b4e2
2 changed files with 6 additions and 3 deletions

View File

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

View File

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