[ 
https://issues.apache.org/jira/browse/SOLR-5228?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13945874#comment-13945874
 ] 

Jan Høydahl commented on SOLR-5228:
-----------------------------------

If anyone plans to remove support for the old syntax in 5.x, remember that it 
should be possible for people to upgrade the WAR to 5.x while keeping their 
existing config and schema without things crashing. I.e. when parsing chema, 
deprecate/fail depending on <luceneMatchVersion> in solrconfig, not depending 
on actual Solr version.

A customer of mine has extended schema with their custom namespace and that 
works very well. +1 for validating non-namespaced tags only. This brings to 
memory the [Currency field 
type|https://cwiki.apache.org/confluence/display/solr/Working+with+Currencies+and+Exchange+Rates]
 which takes {{providerClass}} as one of its xml attributes. Then, depending on 
the provider class, it may expect other attributes to exist, such as 
OpenExchangeRatesOrgProvider expecting attributes {{ratesFileLocation}} and 
{{refreshInterval}} without a prefix. It will be hard to strictly validate xml 
attributes that can be user-defined like this, and in fact our core FieldTypes 
are really just plugins too...

All in all I think we'd be in better shape through some simple custom 
validation in Java code which validates the basics such as allowed tags and sub 
tags, and complains if there are unknown tags without a namespace. Perhaps also 
check for existence of misspelled stuff such as multivalued, precisionstep etc. 
Then we can save full XSD or whatever for another day :)

> Deprecate <fields> and <types> tags in schema.xml
> -------------------------------------------------
>
>                 Key: SOLR-5228
>                 URL: https://issues.apache.org/jira/browse/SOLR-5228
>             Project: Solr
>          Issue Type: Improvement
>          Components: Schema and Analysis
>            Reporter: Hoss Man
>            Assignee: Erick Erickson
>             Fix For: 4.8, 5.0
>
>         Attachments: SOLR-5228.patch, SOLR-5228.patch
>
>
> On the solr-user mailing list, Nutan recently mentioned spending days trying 
> to track down a problem that turned out to be because he had attempted to add 
> a {{<dynamicField .. />}} that was outside of the {{<fields>}} block in his 
> schema.xml -- Solr was just silently ignoring it.
> We have made improvements in other areas of config validation by generating 
> statup errors when tags/attributes are found that are not expected -- but in 
> this case i think we should just stop expecting/requiring that the 
> {{<fields>}} and {{<types>}} tags will be used to group these sorts of 
> things.  I think schema.xml parsing should just start ignoring them and only 
> care about finding the {{<field>}}, {{<dynamicField>}}, and {{<fieldType>}} 
> tags wherever they may be.
> If people want to keep using them, fine.  If people want to mix fieldTypes 
> and fields side by side (perhaps specify a fieldType, then list all the 
> fields using it) fine.  I don't see any value in forcing people to use them, 
> but we definitely shouldn't leave things the way they are with otherwise 
> perfectly valid field/type declarations being silently ignored.
> ---
> I'll take this on unless i see any objections.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

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

Reply via email to