Querystring SearchΒΆ
The @querystring-search
endpoint given a p.a.querystring query returns the results.
You can call the /@querystring-search
endpoint with a POST
request and the p.a.querystring query in JSON BODY, along with the others querystring options:
POST /plone/@querystring-search HTTP/1.1
Accept: application/json
Authorization: Basic YWRtaW46c2VjcmV0
Content-Type: application/json
{
"query": [
{
"i": "portal_type",
"o": "plone.app.querystring.operation.selection.any",
"v": [
"Document"
]
}
]
}
curl -i -X POST http://nohost/plone/@querystring-search -H 'Accept: application/json' -H 'Content-Type: application/json' --data-raw '{"query": [{"i": "portal_type", "o": "plone.app.querystring.operation.selection.any", "v": ["Document"]}]}' --user admin:secret
echo '{
"query": [
{
"i": "portal_type",
"o": "plone.app.querystring.operation.selection.any",
"v": [
"Document"
]
}
]
}' | http POST http://nohost/plone/@querystring-search Accept:application/json Content-Type:application/json -a admin:secret
requests.post('http://nohost/plone/@querystring-search', headers={
'Accept': 'application/json',
'Content-Type': 'application/json',
}, json={
'query': [{
'i': 'portal_type',
'o': 'plone.app.querystring.operation.selection.any',
'v': ['Document'],
}],
}, auth=('admin', 'secret'))
The server will respond with the results:
HTTP/1.1 200 OK
Content-Type: application/json
{
"@id": "http://localhost:55001/plone/@querystring-search",
"items": [
{
"@id": "http://localhost:55001/plone/front-page",
"@type": "Document",
"description": "Congratulations! You have successfully installed Plone.",
"review_state": "private",
"title": "Welcome to Plone"
},
{
"@id": "http://localhost:55001/plone/testdocument",
"@type": "Document",
"description": "",
"review_state": "private",
"title": "Test Document"
}
],
"items_total": 2
}
The endpoint accepts the same parameters than the querystring search accept:
b_start
b_size
sort_on
sort_order
limit
and also the fullobjects
parameter for return the whole objects instead of the summary serialization of them.