search_data_packages {EDIutils}R Documentation

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")

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:

Multi-value fields:

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

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

Value

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

Note

Only the newest version of data packages are searchable, older versions are not.

When constructing a query note that the 15403 data packages of the ecotrends project and 10492 data packages of the LTER Landsat project, can be excluded from the returned results by including &fq=-scope:(ecotrends+lter-landsat) in the query string.

Examples

## Not run: 

# 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)

## End(Not run)

[Package EDIutils version 1.0.3 Index]