Learn R Programming

EDIutils (version 1.0.3)

search_data_packages: Search data packages

Description

Searches data packages in the EDI data repository using the specified Solr query.

Usage

search_data_packages(query, as = "data.frame", env = "production")

Value

(data.frame or xml_document) Search results containing the fields:

  • abstract

  • begindate

  • doi

  • enddate

  • funding

  • geographicdescription

  • id

  • methods

  • packageid

  • pubdate

  • responsibleParties

  • scope

  • site

  • taxonomic

  • title

  • authors

  • spatialCoverage

  • sources

  • keywords

  • organizations

  • singledates

  • timescales

Arguments

query

(character) Query (see details below)

as

(character) Format of the returned object. Can be: "data.frame" or "xml".

env

(character) Repository environment. Can be: "production", "staging", or "development".

Details

Documents in the EDI data repository Solr index can be discovered based on metadata values stored in the following list of searchable fields (not all EML content is queryable):

Single-value fields:

  • abstract

  • begindate - In ISO format (YYYY-MM-DDThh:mm:ss)

  • doi

  • enddate - In ISO format (YYYY-MM-DDThh:mm:ss)

  • funding

  • geographicdescription

  • id

  • methods

  • packageid - Data Id in "scope.identifier.revision" format

  • pubdate - In ISO format (YYYY-MM-DDThh:mm:ss)

  • responsibleParties

  • scope

  • singledate

  • site

  • taxonomic

  • title

Multi-value fields:

  • author

  • coordinates - Use "IsWithin(West+East+North+South)" where each cardinal direction is in decimal degrees with South of the equator as negative and East of the prime meridian positive.

  • keyword

  • organization

  • projectTitle

  • relatedProjectTitle

  • timescale

query parser: The optimal query parser (defType=edismax) is added to every query.

See Apache Solr Wiki for how to construct a Solr query.

Examples

Run this code
if (FALSE) {

# Search for data packages containing the term "air temperature"
res <- search_data_packages(query = 'q="air+temperature"&fl=*')

# Search for data packages containing the term "air temperature" and
# returning only the packageid, title, and score of each match
res <- search_data_packages(query = 'q="air+temperature"&fl=packageid,title,score')

# Search for data packages containing the term "air temperature", returning
# only the packageid, title, score, and excluding ecotrends and lter-landsat
# scopes from the returned results
query <- paste0('q="air+temperature"&fl=packageid,title,score&',
                'fq=-scope:(ecotrends+lter-landsat)')
res <- search_data_packages(query)
}

Run the code above in your browser using DataLab