Konstantin Gribov created SOLR-7835:
---------------------------------------

             Summary: solr.schema.FieldType#createFields has incorrect check 
for absent docValues
                 Key: SOLR-7835
                 URL: https://issues.apache.org/jira/browse/SOLR-7835
             Project: Solr
          Issue Type: Bug
          Components: Schema and Analysis
    Affects Versions: 5.2.1
            Reporter: Konstantin Gribov
            Priority: Minor


{{lucene.document.FieldType#docValuesType()}} call always return non-null 
result which is protected by setter and copy constructor.

This method is used in {{solr.schema.FieldType#createFields(...)}} to enforce 
valid docValues type for field with {{docValues="true"}} in schema.
Current check is incorrect since it compares {{docValuesType}} to {{null}} 
which is always false.

In case of incorrectly implemented Solr FieldType which overrides 
{{checkSchemaField(...)}} to allow docValues and doesn't override 
{{createFields(...)}} it leads to buggy behavior: user thinks that field use 
docValues (since it's set in schema.xml and solr doesn't indicates any error), 
but really {{UninvertingReader}} with {{fieldValuesCache}} is used for 
faceting, grouping etc.

This issue is only present when user creates his own {{solr.schema.FieldType}} 
implementation because Solr FieldTypes which don't support docValues do not 
override {{checkSchemaField(...)}} method.

I will push pull request with patch and test case in several minutes.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to