Skip to content

API Search enhancement - Returning metadatafields #7863

@FNI18300

Description

@FNI18300

Currently , edu.harvard.iq.dataverse.api.Search.search method takes (master branch) the following parameters :

@QueryParam("q") String query,
@QueryParam("type") final List<String> types,
@QueryParam("subtree") final List<String> subtrees,
@QueryParam("sort") String sortField,
@QueryParam("order") String sortOrder,
@QueryParam("per_page") final int numResultsPerPageRequested,
@QueryParam("start") final int paginationStart,
@QueryParam("show_relevance") boolean showRelevance,
@QueryParam("show_facets") boolean showFacets,
@QueryParam("fq") final List<String> filterQueries,
@QueryParam("show_entity_ids") boolean showEntityIds,
@QueryParam("show_api_urls") boolean showApiUrls,
@QueryParam("show_my_data") boolean showMyData,
@QueryParam("query_entities") boolean queryEntities,

I suggest to add a new parameter (name proposal: metadatafields ) to customize the returned items object.

The syntax of this new parameter could be something like :
metadataset_name:(*|metadata_field_name)[,metadataset_name:(*|metadata field name)]*

This way we could request all metadata fields from a metadataset using : geospatial:*
Or we could request a specific metadata field using : geospatial:bbox
And we could request metadata fields from different metadatasets using : geospatial:*,custom:data1

Impact of this new behaviour could be :

  • edu.harvard.iq.dataverse.api.Search.search to add new parameter
  • edu.harvard.iq.dataverse.search.SolrSearchResult.toJsonObject(boolean, boolean, boolean) to add the requested metadata fields parameter
  • edu.harvard.iq.dataverse.search.SolrSearchResult.json(boolean, boolean, boolean) to add the requested metadata fields and to add fields to add to json Object.

What do you think about this ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions