Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-7835

solr.schema.FieldType#createFields has incorrect check for absent docValues

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 5.2.1
    • Fix Version/s: None
    • Component/s: Schema and Analysis
    • Labels:
      None

      Description

      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.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              grossws Konstantin Gribov
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated: