Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add "string" type for metadata fields #11321

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from

Conversation

vera
Copy link
Contributor

@vera vera commented Mar 10, 2025

What this PR does / why we need it:

See #11147

Which issue(s) this PR closes:

Special notes for your reviewer:

/

Suggestions on how to test this:

  1. Load a metadata block TSV that defines a field with type "string"

    example: https://gist.github.com/vera/fc39e7b0bb0e9da7dc24a41c680f6d59

    curl http://localhost:8080/api/admin/datasetfield/load -H "Content-type: text/tab-separated-values" -X POST --upload-file stringtest.tsv

  2. Activate metadata block

    curl curl -H "X-Dataverse-key:$API_TOKEN" -X POST -H "Content-type:application/json" -d "[\"citation\", \"stringTest\"]" http://localhost:8080/api/dataverses/:root/metadatablocks

  3. Update Solr schema

    curl "http://localhost:8080/api/admin/index/solr/schema" | ./update-fields.sh schema.xml

    docker cp schema.xml solr-1:/var/solr/data/collection1/conf/schema.xml

    curl "http://localhost:8983/solr/admin/cores?action=RELOAD&core=collection1"

  4. Confirm that the updated Solr schema contains a new field with type "string"

     <field name="testStringField" type="string" multiValued="false" stored="true" indexed="true"/>
    ...
     <copyField source="testStringField" dest="_text_" maxChars="3000"/>
    
  5. Create a new dataset via the UI (or API)

    image

  6. Verify the string value correctly ends up in Solr and can be seen on the dataset page

    image

    image

Does this PR introduce a user interface change? If mockups are available, please link/include them here:

/

Is there a release notes update needed for this change?:

Yes, I think that would be good. I've added a release note as part of this PR.

Additional documentation:

/

@ofahimIQSS ofahimIQSS added the Size: 10 A percentage of a sprint. 7 hours. label Mar 11, 2025
@cmbz cmbz added FY25 Sprint 19 FY25 Sprint 19 (2025-03-12 - 2025-03-26) FY25 Sprint 18 FY25 Sprint 18 (2025-02-26 - 2025-03-12) labels Mar 12, 2025
@stevenwinship stevenwinship self-assigned this Mar 12, 2025
@stevenwinship stevenwinship removed their assignment Mar 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
FY25 Sprint 18 FY25 Sprint 18 (2025-02-26 - 2025-03-12) FY25 Sprint 19 FY25 Sprint 19 (2025-03-12 - 2025-03-26) Size: 10 A percentage of a sprint. 7 hours.
Projects
Status: Ready for QA ⏩
Development

Successfully merging this pull request may close these issues.

Feature Request: Add "string" type for metadata fields
4 participants