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

11127 search api counts #11138

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

11127 search api counts #11138

wants to merge 8 commits into from

Conversation

sekmiller
Copy link
Contributor

@sekmiller sekmiller commented Jan 8, 2025

What this PR does / why we need it: Extends the Search API so that if show_type_counts is true then each dv object type will be returned including when the count is 0 - or even if there are no actual results in the search return.

Which issue(s) this PR closes:

Special notes for your reviewer: Pretty straight forward. Added tests to Search IT. Did see some weirdness with my local solr install that seem to be unrelated to this, and I was able to resolve them.

Suggestions on how to test this: Good examples in the ticket. You'll need to exercise the Search API in a way that the results include only some of the object types or return no records at all

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, included

Additional documentation: the Search API documentation does not show the previous behavior of including the show-type-counts param. Should it be added or is this more like an SPA feature that we don't expect regular api users to use?

@sekmiller sekmiller self-assigned this Jan 8, 2025

This comment has been minimized.

@sekmiller sekmiller removed their assignment Jan 8, 2025
@sekmiller sekmiller added FY25 Sprint 14 FY25 Sprint 14 (2025-01-02 - 2025-01-15) Size: 3 A percentage of a sprint. 2.1 hours. labels Jan 8, 2025

This comment has been minimized.

This comment has been minimized.

@coveralls
Copy link

coveralls commented Jan 14, 2025

Coverage Status

coverage: 22.746% (-0.006%) from 22.752%
when pulling 9afbf41 on 11127-search-api-counts
into 6f964a3 on develop.

This comment has been minimized.

@g-saracca g-saracca added SPA These changes are required for the Dataverse SPA SPA.Q4.1 Collection Page: All Filtering Options Original size: 3 GREI Re-arch Issues related to the GREI Dataverse rearchitecture labels Jan 14, 2025
if (showTypeCounts && solrQueryResponse.getTypeFacetCategories().isEmpty()) {
objectTypeCounts.add(SearchConstants.UI_DATAVERSES, 0);
objectTypeCounts.add(SearchConstants.UI_DATASETS, 0);
objectTypeCounts.add(SearchConstants.UI_FILES, 0);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sekmiller I have one question, the properties are sent with the UI namings, shouldn't we use the ones from the Search API instead of the WEB UI ones?

// these are the values we want the user to operate on from the Search API

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was trying to match what we get here: "total_count_per_object_type":{"Dataverses":105,"Datasets":71,"Files":0}}
via objectTypeCounts.add(facetLabel.getName(), facetLabel.getCount());

facetLabel.getName() returns the capitalized version

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's fine, it was just a suggestion, if it works well that way let's leave it as it is.
We can map it to another properties in js-dataverse or spa repo layers.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK. Great. Honestly I was a little unsure of where to get it from, but I didn't want to add another constant anywhere so I used what was available.

@GPortas GPortas added the SPA.Q1 Not related to any specific Q1 feature label Jan 15, 2025

This comment has been minimized.

Copy link

📦 Pushed preview images as

ghcr.io/gdcc/dataverse:11127-search-api-counts
ghcr.io/gdcc/configbaker:11127-search-api-counts

🚢 See on GHCR. Use by referencing with full name as printed above, mind the registry name.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
FY25 Sprint 14 FY25 Sprint 14 (2025-01-02 - 2025-01-15) FY25 Sprint 15 FY25 Sprint 15 (2025-01-15 - 2025-01-29) GREI Re-arch Issues related to the GREI Dataverse rearchitecture Original size: 3 Size: 3 A percentage of a sprint. 2.1 hours. SPA.Q1 Not related to any specific Q1 feature SPA.Q4.1 Collection Page: All Filtering Options SPA These changes are required for the Dataverse SPA
Projects
Status: Ready for Review ⏩
Development

Successfully merging this pull request may close these issues.

Search API - Counts per object type behavior
5 participants