-
Notifications
You must be signed in to change notification settings - Fork 500
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
Search API - Count per object #11280
Comments
FWIW: The SearchIncludeFragment for the page actually does a second search (always for the first page and one object) to get the file info and (I assume) the file related facets. Given that that's an added cost, we might want a flag to avoid it so that uses of search that aren't drawing a search page can avoid it? (That gives the work-around of just making the second call from the SPA, but since we already have the code for it in Java/in the SearchIncludeFragment, it probably makes sense to keep it back end?) |
@qqmyers I understand. |
In case it was not clear, we only need the count of all types for that search, even if they were not sent as type query parameters. |
Sorry - I was confused by doing https://demo.dataverse.org/dataverse/demo/?q=test which shows the file types facets, but I see it also flips to searching for all three types. Consistent with what you're saying, the line I highlighted has addFacets false. w.r.t. the show_type_counts flag - is there ever a time when you want, for examples, file counts to be 0 when you're only searching for collections/datasets? If not, it sounds like that flag's effect could be updated. The query for missing types should certainly be less expensive that the main query so making it probably isn't a big deal, but I still think it would be useful to be able to turn it off, especially for queries for specific fields, spatial queries, etc. where the answer is always zero. |
No, we need to replicate JSF, and when you select Dataverses and Datasets you can still see the count of Files in the UI. So I don't think so no. About adding a new flag I leave that to you on what you think is best. |
What steps does it take to reproduce the issue?
Navigate to https://beta.dataverse.org/spa/collections and open browser dev tools, select the Network tab and filter requests by the word 'search'.
The Search API count per object property is returning as 0 the types that are not sent through the endpoint as
type
query parameters.For example for this API call:
the
total_count_per_object_types
is returned as:The Files count should not be returned as 0 but as 10,059 (that is the current number on beta) , the correct value of existing files even if the query param
type=file
is not sent, this is to replicate JSF counting behaviour in the collection page.To whom does it occur (all users, curators, superusers)?
All SPA Users and API Users
What did you expect to happen?
The API to return the counting on all types even if the
type
query parameter for that type was not sent.Which version of Dataverse are you using?
unstable
The text was updated successfully, but these errors were encountered: