Construct a query

Each Solr query is comprised of a number of parameters. These are like arguments to a function in R, but they are entered as parts of a URL.

The most common parameters are:

  • q: The query. This is like subset() or dplyr::filter() in R.
  • fl: What fields are returned for the documents that match your query (q). If not set, all fields are returned.
  • rows: The maximum number of documents to return. Solr will truncate your result if the result size is greater than rows.
  • sort: Sorts the result by the values in the given Solr field (e.g., sort by date uploaded).

The query (q) parameter uses a syntax that looks like field:value, where field is one of the Solr fields and value is an expression. The expression can match a specific value exactly, e.g., q=identifier:arctic-data.7747.1 or q=identifier:"doi:10.5065/D60P0X4S", which finds the Solr document for a specific Object by PID (identifier).

In the second example, the DOI PID is surrounded in double quotes. This is because Solr has reserved characters, of which : is one, so we have to help Solr by surrounding values with reserved characters in them in quotes or by escaping them.

To view the list of query-able parameters on the Arctic Data Center and their descriptions, you can visit https://arcticdata.io/metacat/d1/mn/v2/query/solr.