Hi Dataverse team!
Right now, a normal search could return two types of results for a given query:
X-Dataverse-key header, will return RELEASED and DRAFT resultsRELEASED ones. Question:
Is there any way that Authenticated requests could retrieve only RELEASED datasets as part of the search response items?
Expected behavior:
For authenticated requests, to have an option that allows retrieving all, only RELEASED or only DRAFT search results items
Thanks!
@tainguyenbui -- if you are an authenticated user, logged into Dataverse, you can filter text search results with Publication Status facets for Published publicationStatus%3A"Published" and Draft publicationStatus%3A"Draft" datasets.
So, an API query using the example from the Advanced Search Example section in the Search API page of our API Guide, would look like this:
https://demo.dataverse.org/api/search?q=test&show_relevance=true&show_facets=true&fq=publicationStatus:Published&type=dataset
Does that help or am I misunderstanding your use case?
@mheppler that is exactly what I needed, but I was struggling to find how to do it in the documentation. Thanks a lot!
@djbrooke, this is now solved on my side. I will update the js-dataverse client to allow fq query parameter
Nice, thanks @tainguyenbui for reporting and @mheppler for answering.
@tainguyenbui is there something that can be added to the docs that would make this easier for others to determine in the future? If so, feel free to make a PR against the docs or let me know your suggestion and I'll update them. Thanks again!
@djbrooke I just created a PR to update documentation
thanks!
@tainguyenbui just wanted to point out that I updated the API query in my comment above to add the missing type=dataset in order to get results for datasets. The query without the type parameter returns dataverses and files, as well as datasets.
@tainguyenbui I'm late to this party but I just looked at pull request #6603 and it's awesome. Thanks! And kudos to @mheppler for helping move this issue along!
@tainguyenbui just wanted to point out that I updated the API query in my comment above to add the missing
type=datasetin order to get results for datasets. The query without the type parameter returns dataverses and files, as well as datasets.
thanks @mheppler !
Most helpful comment
@tainguyenbui I'm late to this party but I just looked at pull request #6603 and it's awesome. Thanks! And kudos to @mheppler for helping move this issue along!