mirror of https://github.com/apache/lucene.git
SOLR-8831: allow _version_ field to be retrievable via docValues
This commit is contained in:
parent
ef916c1e7e
commit
164d6ccd2d
|
@ -192,6 +192,8 @@ New Features
|
||||||
|
|
||||||
* SOLR-8698: params.json can now specify 'appends' and 'invariants' (noble)
|
* SOLR-8698: params.json can now specify 'appends' and 'invariants' (noble)
|
||||||
|
|
||||||
|
* SOLR-8831: allow _version_ field to be retrievable via docValues (yonik)
|
||||||
|
|
||||||
|
|
||||||
Bug Fixes
|
Bug Fixes
|
||||||
----------------------
|
----------------------
|
||||||
|
|
|
@ -61,7 +61,7 @@ public class VersionInfo {
|
||||||
*/
|
*/
|
||||||
public static SchemaField getAndCheckVersionField(IndexSchema schema)
|
public static SchemaField getAndCheckVersionField(IndexSchema schema)
|
||||||
throws SolrException {
|
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);
|
SchemaField sf = schema.getFieldOrNull(VERSION_FIELD);
|
||||||
|
|
||||||
if (null == sf) {
|
if (null == sf) {
|
||||||
|
@ -72,12 +72,12 @@ public class VersionInfo {
|
||||||
if ( !sf.indexed() && !sf.hasDocValues()) {
|
if ( !sf.indexed() && !sf.hasDocValues()) {
|
||||||
throw new SolrException
|
throw new SolrException
|
||||||
(SolrException.ErrorCode.SERVER_ERROR,
|
(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
|
throw new SolrException
|
||||||
(SolrException.ErrorCode.SERVER_ERROR,
|
(SolrException.ErrorCode.SERVER_ERROR,
|
||||||
errPrefix + " (" + VERSION_FIELD + " is not stored");
|
errPrefix + " (" + VERSION_FIELD + " not retrievable");
|
||||||
}
|
}
|
||||||
if ( sf.multiValued() ) {
|
if ( sf.multiValued() ) {
|
||||||
throw new SolrException
|
throw new SolrException
|
||||||
|
|
Loading…
Reference in New Issue