-
Notifications
You must be signed in to change notification settings - Fork 495
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
base: develop
Are you sure you want to change the base?
11127 search api counts #11138
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
if (showTypeCounts && solrQueryResponse.getTypeFacetCategories().isEmpty()) { | ||
objectTypeCounts.add(SearchConstants.UI_DATAVERSES, 0); | ||
objectTypeCounts.add(SearchConstants.UI_DATASETS, 0); | ||
objectTypeCounts.add(SearchConstants.UI_FILES, 0); |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
This comment has been minimized.
This comment has been minimized.
📦 Pushed preview images as
🚢 See on GHCR. Use by referencing with full name as printed above, mind the registry name. |
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?