Index JSON object to Solr / Goobi viewer


I was wondering how to index nested object into Solr / Goobi viewer?. Let’s say, instead of having structure like this:

"MD_CREATORS" :["Selmer, Marcus ; Berge, Øyvind"]

I would like to have something like:

"actors": [
  "name": "Selmer, Marcus" ,
  "uri": "" ,
  "role" : {
      "name" :  "creator"
 "name": "Berge, Øyvind" , 
 "uri": "", 
  "role" : {
      "name" :  "author"

How do I achieve that? Thank you!

Hi @hemed ,

is the basis for indexing METS/MODS? If yes, can you please provide an example MODS snippet for the two persons you mentioned above?


Jan :slight_smile:

Hi @jan ! Thank you for the reply. Please find below the METS/MODS snippet for the persons. You can also see full METS from our test instance here:

<mods:name type="personal" valueURI="">
<mods:roleTerm authority="marcrelator" type="code">aut</mods:roleTerm>
<mods:namePart type="family">Paulsen</mods:namePart>
<mods:namePart type="given">Bernth</mods:namePart>
<mods:displayForm>Paulsen, Bernth</mods:displayForm>
<mods:name type="personal" valueURI="">
<mods:roleTerm authority="marcrelator" type="code">aut</mods:roleTerm>
<mods:namePart type="family">Selmer</mods:namePart>
<mods:namePart type="given">Marcus</mods:namePart>
<mods:displayForm>Selmer, Marcus</mods:displayForm>
<mods:name type="personal" valueURI="">
<mods:roleTerm authority="marcrelator" type="code">cre</mods:roleTerm>
<mods:namePart type="family">Berge</mods:namePart>
<mods:namePart type="given">Øyvind</mods:namePart>
<mods:displayForm>Berge, Øyvind</mods:displayForm>

Do you visually mean something like this?
Bildschirmfoto von 2021-08-19 11-43-35

This is encoded in MODS the following way:

<mods:name authority="gnd" authorityURI="" type="personal" valueURI="">
    <mods:roleTerm authority="marcrelator" type="code">edt</mods:roleTerm>
  <mods:namePart type="family">Plenzat</mods:namePart>
  <mods:namePart type="given">Karl</mods:namePart>
  <mods:displayForm>Plenzat, Karl</mods:displayForm>
<mods:name authority="gnd" authorityURI="" type="personal" valueURI="">
    <mods:roleTerm authority="marcrelator" type="code">aut</mods:roleTerm>
  <mods:namePart type="family">Eckmann</mods:namePart>
  <mods:namePart type="given">Heinrich</mods:namePart>
  <mods:displayForm>Eckmann, Heinrich</mods:displayForm>

The configuration of the Solr field in the solr_indexerconfig.xml is as follows:

      <groupEntity type="PERSON">
        <!-- MODS -->
        <field name="MD_VALUE">mods:displayForm</field>
        <field name="MD_DISPLAYFORM">mods:displayForm</field>
        <field name="MD_LINK">@xlink:href</field>
        <field name="MD_CORPORATION">mods:namePart[not(@type)]</field>
        <field name="MD_LASTNAME">mods:namePart[@type="family"]</field>
        <field name="MD_FIRSTNAME">mods:namePart[@type="given"]</field>
        <field name="MD_LIFEPERIOD">mods:namePart[@type="date"]</field>
        <field name="MD_TERMSOFADDRESS">mods:namePart[@type="termsOfAddress"]</field>

        <!-- LIDO -->
        <field name="MD_VALUE">lido:nameActorSet/lido:appellationValue[@lido:pref="preferred"]</field>
        <field name="MD_DISPLAYFORM">lido:nameActorSet/lido:appellationValue[@lido:pref="preferred"]</field>
        <field name="MD_DOB">lido:vitalDatesActor/lido:earliestDate[@lido:type="Geburtsdatum"]</field>
        <field name="MD_DOD">lido:vitalDatesActor/lido:latestDate[@lido:type="Sterbedatum"]</field>
        <field name="NORM_URI">lido:actorID[@lido:source=""]</field>

        <!-- DUBLIN CORE -->
        <field name="MD_VALUE">text()</field>
        <field name="MD_SUBJECT">text()</field>

It is displayed on the metadata page with the following configuration in the config_viewer.xml:

<metadata label="MD_CREATOR" value="MASTERVALUE_SIMPLE_GROUP" group="true">
  <param type="field" key="MD_VALUE"/>
  <param type="field" key="NORM_WIKIPEDIAURL" value="LINK_WIKIPEDIA_FULL"/>
  <param type="normdatauri" key="NORM_URI"/>
  <param type="normdatasearch" key="NORM_IDENTIFIER"/>

This are grouped metadata, you can find them in the Solr index when you search with the field PI_TOPSTRUCT instead of PI and combine it with the METADATATYPE:PERSON

Does this help?


Jan :slight_smile:

1 Like

Thank you @jan . This looks great, I will try it out!

My usecase was actually to query Goobi viewer from another front-end system. I was therefore interested in getting all metadata from a particular record in JSON format, similar to mainifest API. Is this possible? Otherwise I would have to query Solr directly?

Best regards,

Hi @hemed,

I don’t think that we have something for your usecase. We usually suggest to work with the IIIF API and we implemented a iiif_simple mode that ignores all resources from files and is faster and simpler, but it still won’t output the information in the desired format.

BUT: You should look at the REST API in case I missed something:

We are open for pull requests, too :wink: