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

Andrzej Bialecki edited comment on SOLR-18678 at 11/23/26, 12:53 PM:
---------------------------------------------------------------------

Implementation that uses typed entries could be represented as a 
{{NamedList<Object>}} and reuse the existing XML wrangling helpers to support 
types defined in {{{}DomUtil.NL_TAGS{}}}.

This would allow for the following:
{code:xml}
<field name="id" type="string" indexed="true" stored="true">
  <meta>
    <str name="dc:description">unique document identifier</str>
    <str name="dc:source">Product catalog 1234/ABCDEF/2026</str>
    <bool name="ext:internal">false</bool>
    <int name="ext:max_length">32</int>
  </meta>
</field>
{code}

This could also support nested metadata, arrays and maps if needed.


was (Author: ab):
Implementation that uses typed entries could be represented as a 
{{NamedList<Object>}} and reuse the existing XML wrangling helpers to support 
types defined in {{{}DomUtil.NL_TAGS{}}}.

This would allow for the following:
{code:xml}
<field name="id" type="string" indexed="true" stored="true">
  <meta>
    <str name="dc:description">unique document identifier</str>
    <str name="dc:source">Product catalog 1234/ABCDEF/2026</str>
    <bool name="ext:internal">false</bool>
    <int name="ext:max_length">32</int>
  </meta>
</field>
{code}

> Part 1: Add metadata to IndexSchema and SchemaField, and XML round-trip
> -----------------------------------------------------------------------
>
>                 Key: SOLR-18678
>                 URL: https://issues.apache.org/jira/browse/SOLR-18678
>             Project: Solr
>          Issue Type: Sub-task
>            Reporter: Andrzej Bialecki
>            Priority: Major
>
> Add schema metadata persisted in the schema XML as a child {{<metadata>}} 
> element with type-less {{<entry name="...">value</entry>}} children (or 
> perhaps typed str, int, bool, float, ...?).
> This format is rolling-upgrade safe, because older nodes ignore child 
> elements. Classic schema.xml parsing and managed-schema writing both support 
> it.
> Fields, dynamic fields and field types are included. There should be also a 
> top-level {{<metadata>}} element for the whole schema.
> Add necessary plumbing to IndexSchema and SchemaField classes.
> Schema metadata never affects indexing, queries or schema compatibility 
> checks, so a metadata-only change needs no reindex. Length caps on keys, 
> values and total size keep ZooKeeper nodes small. Tests will cover the XML 
> round-trip and a rolling-upgrade case where an older node loads the new 
> schema.



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

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

Reply via email to