Ask Your Question

SOLR parameters in REST API

asked 2014-05-29 03:34:08 -0500

anonymous user


Hello. I am trying to use parameter rows in the url like this:

curl -X GET $NODE/v1/query/solr/?q=isDocumentedBy:"%5B*%20TO%20*%5B"&rows=1000

but the execution recognizes only the first part, not recognizing rows. I also tried escaping the ampersand. Is there a way to get more than 10 query results? Thank you.

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2014-05-29 07:06:28 -0500

vieglais gravatar image

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:


The full URL would then be something like:


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:


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

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:


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

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

[hide preview]

Question Tools


Asked: 2014-05-29 03:34:08 -0500

Seen: 20,031 times

Last updated: May 29 '14