GitHub user grossws opened a pull request:

    https://github.com/apache/lucene-solr/pull/197

    Incorrect absent docValues check

    `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 think 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.
    
    Test to demonstrate this issue is added to `DocValuesTest` class.
    
    Fixes SOLR-7835.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/grossws/lucene-solr fix-dv-unsupported

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/lucene-solr/pull/197.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #197
    
----
commit 0a43d76a83ff00894c5cade02cf01ce7ec43f701
Author: Konstantin Gribov <[email protected]>
Date:   2015-07-08T12:54:33Z

    Incorrect absent docValues check
    
    `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 think 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.
    
    Test to demonstrate this issue is added to `DocValuesTest` class.
    
    Fixes SOLR-7835.

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

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

Reply via email to