how to handle long NXSQL query with REST API?
Hi,
I want to post a simple NXSQL query using RESTAPI.
SELECT * FROM my_document_type WHERE ecm:path STARTSWITH '/my_path/xx'
=> This query is OK when launched from the AdvancedSearch dialog (possibly resulting several pages)
=> The result is OK when the answer is rather small.
But if I post this query looking a very crowded location, it fails.
I suspect that the reason is indeed the length of the result.
=> how to handle multi page result of a request?
Thanks for any advice
Christian
0 votes
1 answers
1665 views
here is the error I get:
ERROR:root:HTTP Error 502: Proxy Error ERROR:root:<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <html><head> <title>502 Proxy Error</title> </head><body> <h1>Proxy Error</h1> <p>The proxy server received an invalid response from an upstream server.<br /> The proxy server could not handle the request <em><a href="/nuxeo/site/automation/Document.Query">POST /nuxeo/site/automation/Document.Query</a></em>.<p> Reason: <strong>Error reading from remote server</strong></p></p> </body></html>
The RESTAPI command (written in python) was:
urllib2.Request(command, data, headers)
with:
command = https://atrium-dev.in2p3.fr/nuxeo/site/automation/Document.Query data = {"params": {"currentPageIndex": 0, "maxPageSize": 100, "query": "SELECT * FROM StructureProjet WHERE ecm:path STARTSWITH \'/Atrium.1391702958298/Projets/SPIRAL2/\'"}} headers = {u'X-NXDocumentProperties': u'*', u'Content-Type': u'application/json+nxrequest', u'Authorization': u'Basic QWRtaW5f…'}
===> question: is there a way to specify that I want to receive a multipage answer? I tried using the maxPageSize & currentPageIndex parameters, but with no effect
Thanks Chrisitan