Skip to content

Conversation

@vera
Copy link
Contributor

@vera vera commented Jun 6, 2025

What this PR does / why we need it:

This PR adds a show_collections parameter for dataset results to the search API.
When the parameter is set, each result includes a collections array showing the dataset’s parent and linked collections. Each entry includes id, name, and alias, for example:

"collections": [
  {
    "id": 11,
    "name": "My cool collection",
    "alias": "dvcb50a190"
  }
]

Which issue(s) this PR closes:

Not aware of any issue.

Special notes for your reviewer:

/

Suggestions on how to test this:

Create at least one dataset, run searches via the search API with and without show_collections=true to see that if the param is set, the list of collections is returned, otherwise the search response is unchanged.

I've added a test: mvn test -Dtest="SearchIT#testShowCollections"

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?:

I will add a short release note

Additional documentation:

In our custom UI, we want to display the list of collections of each search result, which is why we would like this feature. See this screenshot:

image

@coveralls
Copy link

coveralls commented Jun 6, 2025

Coverage Status

coverage: 23.223% (+2.5%) from 20.726%
when pulling a111fa5 on vera:feat/search-api-collections
into 20aaf5a on IQSS:develop.

@pdurbin pdurbin moved this to Ready for Triage in IQSS Dataverse Project Jun 6, 2025
@ofahimIQSS ofahimIQSS added the Size: 10 A percentage of a sprint. 7 hours. label Jun 17, 2025
@ofahimIQSS ofahimIQSS moved this from Ready for Triage to Ready for Review ⏩ in IQSS Dataverse Project Jun 17, 2025
@cmbz cmbz added FY25 Sprint 25 FY25 Sprint 25 (2025-06-04 - 2025-06-18) FY25 Sprint 26 FY25 Sprint 26 (2025-06-18 - 2025-07-02) labels Jun 18, 2025
@cmbz cmbz added the FY26 Sprint 1 FY26 Sprint 1 (2025-07-02 - 2025-07-16) label Jul 2, 2025
@stevenwinship
Copy link
Contributor

Please resolve the conflicts.

@stevenwinship stevenwinship moved this from Ready for Review ⏩ to In Review 🔎 in IQSS Dataverse Project Jul 16, 2025
@cmbz cmbz added the FY26 Sprint 2 FY26 Sprint 2 (2025-07-16 - 2025-07-30) label Jul 17, 2025
@stevenwinship stevenwinship removed their assignment Jul 23, 2025
@stevenwinship stevenwinship moved this from In Review 🔎 to Ready for Review ⏩ in IQSS Dataverse Project Jul 23, 2025
@stevenwinship stevenwinship added the Status: Needs Input Applied to issues in need of input from someone currently unavailable label Jul 23, 2025
@stevenwinship stevenwinship self-assigned this Jul 23, 2025
@stevenwinship stevenwinship moved this from Ready for Review ⏩ to In Review 🔎 in IQSS Dataverse Project Jul 23, 2025
vera added 2 commits July 29, 2025 17:31
# Conflicts:
#	doc/sphinx-guides/source/api/search.rst
#	src/main/java/edu/harvard/iq/dataverse/api/Search.java
#	src/main/java/edu/harvard/iq/dataverse/search/SearchIncludeFragment.java
#	src/main/java/edu/harvard/iq/dataverse/search/SolrSearchServiceBean.java
@vera
Copy link
Contributor Author

vera commented Jul 29, 2025

@stevenwinship the conflicts have been resolved.

@pdurbin pdurbin removed the Status: Needs Input Applied to issues in need of input from someone currently unavailable label Jul 29, 2025
@stevenwinship
Copy link
Contributor

There is one test failing

testShowCollections – edu.harvard.iq.dataverse.api.SearchIT
6s
Error

1 expectation failed.
JSON path data.items[0].collections[0].id doesn't match.
Expected: is <344>
Actual: <346>
Stacktrace

java.lang.AssertionError:
1 expectation failed.
JSON path data.items[0].collections[0].id doesn't match.
Expected: is <344>
Actual: <346>

@cmbz cmbz added the FY26 Sprint 3 (2025-07-30 - 2025-08-13) label Jul 31, 2025
@vera
Copy link
Contributor Author

vera commented Jul 31, 2025

It seems like the test was flaky because the order of the collections being returned wasn't fixed. It should work now.

@github-project-automation github-project-automation bot moved this from In Review 🔎 to Ready for QA ⏩ in IQSS Dataverse Project Aug 6, 2025
@ofahimIQSS ofahimIQSS self-assigned this Aug 6, 2025
@ofahimIQSS ofahimIQSS moved this from Ready for QA ⏩ to QA ✅ in IQSS Dataverse Project Aug 6, 2025
@cmbz cmbz added the FY26 Sprint 4 FY26 Sprint 4 (2025-08-13 - 2025-08-27) label Aug 14, 2025
@ofahimIQSS
Copy link
Contributor

tests are passing - merging PR

@ofahimIQSS ofahimIQSS merged commit 353ca92 into IQSS:develop Aug 14, 2025
16 checks passed
@github-project-automation github-project-automation bot moved this from QA ✅ to Merged 🚀 in IQSS Dataverse Project Aug 14, 2025
@ofahimIQSS ofahimIQSS removed their assignment Aug 14, 2025
@scolapasta scolapasta moved this from Merged 🚀 to Done 🧹 in IQSS Dataverse Project Aug 14, 2025
@pdurbin pdurbin added this to the 6.8 milestone Aug 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

FY25 Sprint 25 FY25 Sprint 25 (2025-06-04 - 2025-06-18) FY25 Sprint 26 FY25 Sprint 26 (2025-06-18 - 2025-07-02) FY26 Sprint 1 FY26 Sprint 1 (2025-07-02 - 2025-07-16) FY26 Sprint 2 FY26 Sprint 2 (2025-07-16 - 2025-07-30) FY26 Sprint 3 (2025-07-30 - 2025-08-13) FY26 Sprint 4 FY26 Sprint 4 (2025-08-13 - 2025-08-27) Size: 10 A percentage of a sprint. 7 hours.

Projects

Status: Done 🧹

Development

Successfully merging this pull request may close these issues.

6 participants