Skip to content
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

Document search facets in the Search API Guide #9515

Open
DS-INRAE opened this issue Apr 12, 2023 · 3 comments
Open

Document search facets in the Search API Guide #9515

DS-INRAE opened this issue Apr 12, 2023 · 3 comments

Comments

@DS-INRAE
Copy link
Member

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 .

@pdurbin
Copy link
Member

pdurbin commented Apr 12, 2023

@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

@pdurbin pdurbin changed the title Feature Request/Idea: [API Search] Document metadataSource facet in the API Guide Document metadataSource facet in the Search API Oct 9, 2023
@pdurbin pdurbin added Type: Suggestion an idea Feature: API Feature: API Guide Help Wanted: Documentation Mentor: pdurbin User Role: API User Makes use of APIs hacktoberfest It's Hacktoberfest! https://groups.google.com/g/dataverse-community/c/n_Nn_T2yA-w/m/BcoXO4tEAQAJ and removed Help Wanted: Documentation Mentor: pdurbin hacktoberfest It's Hacktoberfest! https://groups.google.com/g/dataverse-community/c/n_Nn_T2yA-w/m/BcoXO4tEAQAJ labels Oct 9, 2023
@DS-INRAE
Copy link
Member Author

Following this PR, license should also be added in the available facets :)

@DS-INRAE DS-INRAE changed the title Document metadataSource facet in the Search API Document search facets in the Search API Guide Jan 11, 2024
@DS-INRAE
Copy link
Member Author

Putting this back in "Needed" rather than planned development so someone else may have a go on this if they want/have the time :)

@DS-INRAE DS-INRAE moved this to ⚠️ Needed/Important in Recherche Data Gouv Jul 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: ⚠️ Needed/Important
Development

No branches or pull requests

2 participants