Varun Thacker created SOLR-10533:
------------------------------------
Summary: Improve checks for which fields can be returned
Key: SOLR-10533
URL: https://issues.apache.org/jira/browse/SOLR-10533
Project: Solr
Issue Type: Bug
Security Level: Public (Default Security Level. Issues are Public)
Reporter: Varun Thacker
I tried using {{DocBasedVersionConstraintsProcessorFactory}} on a field which
was defined as :
{code}
<field name="myVersionField" type="long" indexed="false" stored="false"/>
{code}
The long fieldType has docValues enabled and since useDocValuesAsStored is true
by default in the latest schema I can retrieve this field.
But when I start Solr with this update processor I get the following error
{code}
Caused by: field myVersionField must be defined in schema, be stored, and be
single valued.
{code}
Here's the following check in the update processor where the error originates
from:
{code}
if (userVersionField == null || !userVersionField.stored() ||
userVersionField.multiValued()) {
throw new SolrException(SERVER_ERROR,
"field " + versionField + " must be defined in schema, be stored, and
be single valued.");
}
{code}
We should improve the condition to also check if the field docValues is true
and useDocValuesAsStored is true then don't throw this error.
Hoss pointed out in an offline discussion that this issue could be there in
other places in the codebase so keep this issue broad and not just tackle
DocBasedVersionConstraintsProcessorFactory.
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]