Open DS-INRAE opened 1 year ago
@DS-INRA thanks for opening this issue!
For now, to get a list of facets, you can try this:
curl -s "https://dataverse.harvard.edu/api/search?q=*&show_facets=true" | jq '.data.facets[] | keys[]' -r
authorAffiliation_ss
authorName_ss
dvCategory
fileAccess
fileTag
fileTypeGroupFacet
metadataSource
publicationDate
subject_ss
Then, to see a single facet:
curl -s "https://dataverse.harvard.edu/api/search?q=*&show_facets=true" | jq '.data.facets[].metadataSource'
{
"friendly": "Metadata Source",
"labels": [
{
"Harvard Dataverse": 1445531
},
{
"Harvested": 776606
}
]
}
Let's check that the total count of 776606 matches if we select only harvested:
curl -s "https://dataverse.harvard.edu/api/search?q=*&fq=metadataSource:Harvested" | jq . | head
{
"status": "OK",
"data": {
"q": "*",
"total_count": 776606,
"start": 0,
"spelling_alternatives": {},
"items": [
{
"name": "The French Venus (Catalogue Vol. 2.1)",
Yes, looks good. 😄
By the way @DS-INRA, are you interested in making a pull request? The file to edit is https://github.com/IQSS/dataverse/blob/develop/doc/sphinx-guides/source/api/search.rst and we have tips at https://guides.dataverse.org/en/5.13/developers/documentation.html
Following this PR, license should also be added in the available facets :)
Putting this back in "Needed" rather than planned development so someone else may have a go on this if they want/have the time :)
Overview of the Feature Request Document
metadataSource
facet in the API Seach Guide, maybe alongside other currently undocumented facets.What kind of user is the feature intended for? API User
What inspired the request? Need to filter Harvested datasets
What existing behavior do you want changed? Add this facet to the examples in the Advanced Search section of the API Seach Guide .