[ https://issues.apache.org/jira/browse/SOLR-9529?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15500294#comment-15500294 ]
Trey Grainger commented on SOLR-9529: ------------------------------------- Hmm... things were more inconsistent than I thought. There were two fundamental kinds of inconsistencies: 1) Inconsistencies within a single schema. --This is what I described in the issue description regarding "*_dts" being handled incorrectly. I submitted a pull request to fix this in the three places we actually define both singular and plural field types: solr/example/files/conf/managed-schema solr/server/solr/configsets/basic_configs/conf/managed-schema solr/server/solr/configsets/data_driven_schema_configs/conf/managed-schema 2) Inconsistencies across different schemas While the three schemas listed above all separate out single valued and multiValued dynamic fields into different singular and plural field types, every other schema that ships with Solr only defines a single field type (string, boolean, etc.) and uses the dynamic field definition to determine whether the dynamic field should be single or multivalued. This works fine, of course, but is just inconsistent depending upon which schema file you actually end up using. Interestingly, the tech products example (solr/server/solr/configsets/sample_techproducts_configs/conf/managed-schema), which sits at the same level as the basic_configs and the data_driven_schema_configs, for some reason handles these definitions differently, only defining one field type for both single and multivalued fields (for all types). The following places do the same thing: solr/core/src/test-files/solr/collection1/conf/schema-distrib-interval-faceting.xml solr/core/src/test-files/solr/collection1/conf/schema-docValuesFaceting.xml solr/core/src/test-files/solr/collection1/conf/schema-docValuesJoin.xml solr/core/src/test-files/solr/collection1/conf/schema-non-stored-docvalues.xml solr/core/src/test-files/solr/collection1/conf/schema_latest.xml solr/example/example-DIH/solr/db/conf/managed-schema solr/example/example-DIH/solr/mail/conf/managed-schema solr/example/example-DIH/solr/rss/conf/managed-schema solr/example/example-DIH/solr/solr/conf/managed-schema solr/example/example-DIH/solr/tika/conf/managed-schema So while my pull request fixes #1 so that all schemas are consistent with themselves, we still have inconsistency across the various schemas that ship with Solr in terms of what we name the field types for multivalued dynamic fields. If we are going to make these consistent, which way should we go - have a single field type for all single and multivalued fields (and define multivalued=true on the dynamic field definition instead), or separate out plural versions of the field type (booleans, strings, etc.) for multivalued fields? > Dates Dynamic Field Inconsistently Defined in Schemas > ----------------------------------------------------- > > Key: SOLR-9529 > URL: https://issues.apache.org/jira/browse/SOLR-9529 > Project: Solr > Issue Type: Bug > Security Level: Public(Default Security Level. Issues are Public) > Reporter: Trey Grainger > Priority: Minor > > 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. -- This message was sent by Atlassian JIRA (v6.3.4#6332) --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org