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

Dates Dynamic Field Inconsistently Defined in Schemas

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 9.1
    • None
    • None

    Description

      There is a nice convention across all of the schemas that ship with Solr to include field types for single valued fields (i.e. "string" -> "_s", "boolean" -> "_b") and separate field types for multivalued fields (i.e. "strings" -> "_ss", "booleans" -> "_bs"). Those definitions all follow the pattern (using "string" as an example):

      <fieldType name="string" class="solr.StrField" sortMissingLast="true"/>
      <fieldType name="strings" class="solr.StrField" sortMissingLast="true" multiValued="true"/>
      <dynamicField name="*_s" type="strings" indexed="true" stored="true"/>
      <dynamicField name="*_ss" type="strings" indexed="true" stored="true"/>

      For some reason, however, the "date" field type doesn't follow this pattern, and is instead defined (inconsistently) as follows:
      <fieldType name="date" class="solr.TrieDateField" positionIncrementGap="0" precisionStep="0"/>
      <fieldType name="dates" class="solr.TrieDateField" positionIncrementGap="0" multiValued="true" precisionStep="0"/>
      <dynamicField name="*_dt" type="date" indexed="true" stored="true"/>
      <dynamicField name="*_dts" type="date" multiValued="true" indexed="true" stored="true"/>

      Note specifically that the "_dts" field should instead be referencing the "dates" type and not the "date" type, and that subsequently the multiValued="true" setting would become unnecessary on the "_dts" dynamicField definition.

      I'll get a patch posted for this. Note that nothing is functionally broken, it's just inconsistent and could be confusing for someone looking through the schema or seeing their multivalued dates getting indexed into the field type defined for single valued dates.

      Attachments

        Activity

          People

            epugh Eric Pugh
            solrtrey Trey Grainger
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 1h 10m
                1h 10m