Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

The query string decoded is:

/v1/query/solr/?q=isDocumentedBy:"[* TO *["&rows=1000

Which is attempting to perform a literal search on the value "[* TO *[" within the isDocumentedBy field. It looks like the query is intended to find all documents that have a isDocumentedBy value. The correct form for such a query is:

q=isDocumentedBy:[* TO *]

encoded as a URL fragment would be:

isDocumentedBy%3A%5B*%20TO%20*%5D

The full URL would then be something like:

${NODE}/v1/query/solr/?q=isDocumentedBy%3A%5B*%20TO%20*%5D&rows=100

which is a very verbose response. The list of fields returned may be restricted using the "fl" parameter, so for example, to retrieve the list of identifiers of objects that have an isDocumentedBy entry:

${NODE}/v1/query/solr/?q=isDocumentedBy%3A%5B*%20TO%20*%5D&rows=100&fl=id

A list of identifiers could then be retrieved by processing the resulting xml using a tool such as xmlstarlet:

NODE="https://cn.dataone.org/cn"
curl -s "${NODE}/v1/query/solr/?q=isDocumentedBy%3A%5B*%20TO%20*%5D&rows=100&fl=id" | \
xmlstarlet sel -t -m "//doc" -v "str[@name='id']" -n

with the result:

doi:10.6085/AA/SHLX00_XXXIBTNXTSR01_20120815.40.1
ark:/13030/m5vt1qt7/2/cadwsap-s3600375-001-vuln.csv
ark:/13030/m5vt1qt7/2/cadwsap-s3600375-001.pdf
...
doi:10.6085/AA/SCPXXX_015MTBD003R00_20021018.40.1

Which is a list of all objects that are documented by some other object as asserted by an OAI-ORE resource map document.