I have the following XQuery that I use to get documents for a directory.
xquery version "1.0-ml";
cts:search(fn:collection(), cts:directory-query("/Path/To/Docs/", "infinity"))
Now I need to translate this into a REST call, but I can’t crack it by following the documentation on this page.
https://docs.marklogic.com/REST/GET/v1/search
Update:
using the Jersey REST API, he tried this but got 406 errors
String query = "{\"queries\":[ {\"directory-query\":{\"uri\":[\"/Path/to/Docs/\"]},\"infinite\":true} ]}";
String encodedQuery = URLEncoder.encode(query, "UTF-8");
WebTarget target = searchWebTarget.queryParam("structuredQuery", encodedQuery);
final Response response = target.request().get();
Any ideas?
source
share