Search API - Counts per object type behavior #11127
Labels
FY25 Sprint 14
FY25 Sprint 14 (2025-01-02 - 2025-01-15)
GREI Re-arch
Issues related to the GREI Dataverse rearchitecture
Original size: 10
Size: 10
A percentage of a sprint. 7 hours.
SPA.Q4.1
Collection Page: All Filtering Options
SPA
These changes are required for the Dataverse SPA
Type: Bug
a defect
Recently a new query param has been added to the search api in order to return the count per object type(
&show_type_counts=true
).To fully replicate the JSF version, we should change two different behaviors of how and when this object is returned.
First behaviour:
We need the 3 object types to always be present in the object regardless of the object types sent by the URL.
For example for this search 👇
https://beta.dataverse.org/api/v1/search?q=*&subtree=root&per_page=10&type=dataverse&type=dataset&show_type_counts=true
We have this response 👇, but we need that even if we have not sent the type=file, the count on them is returned anyway and that applies to all object types.
Second behaviour:
When doing a search that finds no results, the object “total_count_per_object_type” is not returned at all.
For example for this search 👇
https://beta.dataverse.org/api/v1/search?q=ioioioioio&subtree=root&per_page=10&type=dataverse&type=dataset&show_type_counts=true
We have this response 👇, I think it might be better to keep sending the object with each property set to 0 even if no results were found, to respect what the API says to return when sending
&show_type_counts=true
The text was updated successfully, but these errors were encountered: