Skip to content

Make Solr schema.xml configuration more flexible, still using Classic Schema Factory #6142

@poikilotherm

Description

@poikilotherm

This issue is related to #5989.

Context and differentiation
#5989 is about changing the entire way of how schemas are handled and requires a lot of changes in Dataverse code, too. This is good and should be done.

This issue is about having a small workaround for easier deployment of custom metadata fields into the Solr schema, but still using the classic schema factory (in contrast to managed schema used by @pkiraly).

Idea
While getting gdcc/dataverse-kubernetes#85 ready for us (see also #6000), I thought about how to handle this. My basic idea:

  1. Remove this and this from schema.xml
  2. Create a file schema_dv_cmb_copies.xml and place all <copyField> from above in there.
  3. Create a file schema_dv_cmb_fields.xml and place all <field> from above in there.
  4. Include these in schema.xml:
<xi:include href="schema_dv_cmb_copies.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
<xi:include href="schema_dv_cmb_fields.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>

(see also https://stackoverflow.com/questions/16968986)

This can be bundled in upstream and is transparent/usable for all type of installations, as long as the relevant files are moved around. Existing installations can continue to use their custom schemas. This approach is way easier than a template with necessary extra steps.

On changing the blocks or adding its own:

  1. the API generated fields can be replaced by a script, fetching from <dvhost>/api/admin/index/solr/schema
  2. Replace the above files content
  3. Execute a RELOAD (see https://stackoverflow.com/questions/23782123)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions