Dataverse: Authenticated Search to retrieve ALL, only RELEASED or only DRAFT dataset items

Created on 3 Feb 2020  路  7Comments  路  Source: IQSS/dataverse

Hi Dataverse team!

Right now, a normal search could return two types of results for a given query:

  • Authenticated request, the one that provides X-Dataverse-key header, will return RELEASED and DRAFT results
  • Unauthenticated requests will only return RELEASED 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!

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!

All 7 comments

@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=dataset in order to get results for datasets. The query without the type parameter returns dataverses and files, as well as datasets.

thanks @mheppler !

Was this page helpful?
0 / 5 - 0 ratings